/* ─── Global Variables ─── */
:root {
    --primary-color: #2596be;
    --dark-color: #0c3240;
    --light-color: #d3e9f2;
    --bg-gradient: linear-gradient(135deg, #f0f7fa 0%, #d3e9f2 100%);
    --bg-body: #f0f7fa;
    --sidebar-width: 260px;
    --header-height: 64px;
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f0f7fa;
    --sidebar-active: linear-gradient(135deg, #2596be 0%, #1d7696 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.10);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Base Reset ─── */
*, *::before, *::after {
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: 'Inter', sans-serif;
    margin: 0;
    background: var(--bg-body);
    color: #1f2937;
    overflow-x: hidden;
}

/* ─── Layout: Auth/Public (app.blade.php) ─── */
.layout-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.layout-wrapper .main-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background: var(--bg-gradient);
}

.app-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(37, 150, 190, 0.15);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.app-footer {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(37, 150, 190, 0.15);
    padding: 1.5rem 0;
    color: var(--dark-color);
    font-size: 0.9rem;
}

/* ─── Login Page ─── */
.login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(37, 150, 190, 0.15);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 1);
    transition: transform 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
}

.login-title {
    color: var(--dark-color);
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-align: center;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: #6b7280;
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

/* ─── Layout: Dashboard/Web (web.blade.php) ─── */
.dashboard-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(37,150,190,0.12);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1100;
    transition: var(--transition);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: var(--sidebar-width);
    text-decoration: none;
}

.header-brand i {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.header-brand span {
    font-weight: 800;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ─── Sidebar ─── */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(37,150,190,0.10);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1050;
    padding: 1.25rem 0;
    transition: var(--transition);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
    padding: 0.25rem;
    margin-right: 0.75rem;
    border-radius: 0.5rem;
}

.sidebar-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #9ca3af;
    padding: 0.75rem 1.5rem 0.5rem;
}

.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li { padding: 0 0.75rem; margin-bottom: 2px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6875rem 0.875rem;
    border-radius: 0.75rem;
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.sidebar-nav a:hover { background: var(--sidebar-hover); color: var(--dark-color); }
.sidebar-nav a.active { background: var(--sidebar-active); color: #fff; box-shadow: 0 4px 12px rgba(37,150,190,0.3); }
.sidebar-nav a i { font-size: 1.125rem; color: #9ca3af; transition: var(--transition); }
.sidebar-nav a.active i { color: #fff; }

.sidebar-divider { height: 1px; background: rgba(37,150,190,0.08); margin: 0.75rem 1.5rem; }

.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

/* ─── Main Content ─── */
.dashboard-main {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    padding: 2rem;
    background: var(--bg-body);
    transition: var(--transition);
}

.page-header h1 { font-size: 1.75rem; font-weight: 800; color: var(--dark-color); margin: 0; }
.page-header p { color: #6b7280; font-size: 0.95rem; }

/* ─── Components: Welcome & Stats ─── */
.welcome-banner {
    background: linear-gradient(135deg, #2596be 0%, #0c3240 100%);
    border-radius: 1.25rem;
    padding: 2rem 2.5rem;
    color: #ffffff;
    margin-bottom: 2rem;
}

.btn-login {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d7696 100%);
    border: none;
    border-radius: 0.75rem;
    padding: 1rem;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(37, 150, 190, 0.1), 0 2px 4px -1px rgba(37, 150, 190, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 150, 190, 0.25);
    filter: brightness(1.05);
    color: white;
}

.btn-login:active {
    transform: translateY(0);
}

.stats-card {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(37, 150, 190, 0.1);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stats-card:hover { transform: translateY(-4px); box-shadow: 0 10px 25px rgba(37, 150, 190, 0.12); }

.stats-icon { width: 48px; height: 48px; border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.stats-icon.primary { background: #d3e9f2; color: #2596be; }
.stats-icon.blue { background: #dbeafe; color: #3b82f6; }
.stats-icon.purple { background: #f3e8ff; color: #8b5cf6; }

.stats-value { font-size: 1.75rem; font-weight: 800; color: #0c3240; margin: 0; }
.stats-label { font-size: 0.85rem; color: #6b7280; font-weight: 500; }

/* ─── Components: Profiles ─── */
.profiles-card { background: #ffffff; border-radius: 1.25rem; border: 1px solid rgba(37, 150, 190, 0.08); overflow: hidden; }
.profiles-card-header { padding: 1.5rem 1.75rem; border-bottom: 1px solid rgba(37, 150, 190, 0.08); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.profiles-card-header h2 { font-size: 1.25rem; font-weight: 700; color: #0c3240; margin: 0; }

.badge-count { background: linear-gradient(135deg, #2596be, #1d7696); color: #fff; font-weight: 700; font-size: 0.75rem; padding: 0.25rem 0.6rem; border-radius: 2rem; }

.search-box { position: relative; width: 260px; }
.search-box input { width: 100%; padding: 0.5rem 0.875rem 0.5rem 2.5rem; border: 1px solid #e5e7eb; border-radius: 0.75rem; background: #f9fafb; }
.search-box i { position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%); color: #9ca3af; }

.profiles-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.profiles-table thead th { background: #f9fafb; padding: 0.875rem 1.5rem; font-size: 0.75rem; font-weight: 700; color: #6b7280; border-bottom: 1px solid rgba(37, 150, 190, 0.08); }
.profiles-table tbody tr:hover { background: #f8fafc; }
.profiles-table tbody td { padding: 1rem 1.5rem; font-size: 0.9rem; color: #374151; border-bottom: 1px solid #f3f4f6; }

.profile-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.profile-avatar-placeholder { width: 40px; height: 40px; border-radius: 50%; background: var(--sidebar-active); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }

.badge-gender { padding: 0.25rem 0.625rem; border-radius: 2rem; font-size: 0.75rem; font-weight: 600; }
.badge-gender.male { background: #dbeafe; color: #1d4ed8; }
.badge-gender.female { background: #fce7f3; color: #be185d; }

.badge-study { padding: 0.25rem 0.625rem; border-radius: 2rem; font-size: 0.75rem; font-weight: 600; }
.badge-study.yes { background: #d3e9f2; color: #166534; }
.badge-study.no { background: #f3f4f6; color: #6b7280; }

.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-state-icon { width: 80px; height: 80px; margin: 0 auto 1.25rem; border-radius: 50%; background: #f0f7fa; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #2596be; }

.skeleton { background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 0.5rem; height: 16px; display: inline-block; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.animate-in { animation: fadeInUp 0.4s ease-out; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Responsive ─── */
@media (max-width: 991.98px) {
    .sidebar-toggle { display: block; }
    .header-brand { width: auto; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar-overlay.show { display: block; }
    .dashboard-main { margin-left: 0; }
}

@media (max-width: 767.98px) {
    .profiles-card-header { flex-direction: column; align-items: flex-start; }
    .search-box { width: 100%; }
    .profiles-table thead { display: none; }
    .profiles-table tbody tr { display: block; padding: 1rem 1.25rem; border-bottom: 1px solid #f3f4f6; }
    .profiles-table tbody td { display: flex; justify-content: space-between; align-items: center; padding: 0.375rem 0; border-bottom: none; }
    .profiles-table tbody td::before { content: attr(data-label); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; color: #9ca3af; }
}
