:root {
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-logo svg {
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.nav-badge-muted {
    background: rgba(255,255,255,0.1);
    color: var(--sidebar-text);
}

.nav-action {
    margin-top: 8px;
    background: rgba(37, 99, 235, 0.15);
    color: #60a5fa;
    border: 1px dashed rgba(37, 99, 235, 0.3);
}

.nav-action:hover {
    background: rgba(37, 99, 235, 0.25);
    color: #93c5fd;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
}

.user-role {
    color: var(--sidebar-text);
    font-size: 0.75rem;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.8125rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px 32px;
    max-width: calc(100vw - 260px);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.top-bar h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.top-bar-sub {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 2px;
    text-transform: capitalize;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8125rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-highlight {
    border-color: var(--warning);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: var(--primary);
}

.stat-icon-blue {
    background: #eff6ff;
    color: var(--primary);
}

.stat-icon-purple {
    background: #f5f3ff;
    color: var(--purple);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Birthday Banner */
.birthday-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9375rem;
}

.banner-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
    vertical-align: middle;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: #f8fafc;
}

tbody tr.row-today {
    background: #fffbeb;
}

tbody tr.row-today:hover {
    background: #fef3c7;
}

/* Person Cell */
.person-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.avatar-female {
    background: #fce7f3;
    color: #be185d;
}

.avatar-male {
    background: #dbeafe;
    color: #1d4ed8;
}

.person-name {
    font-weight: 600;
    color: var(--text);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-pink {
    background: #fce7f3;
    color: #be185d;
}

.badge-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-gray {
    background: #f1f5f9;
    color: #475569;
}

.badge-green {
    background: #d1fae5;
    color: #065f46;
}

.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.age-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: var(--text);
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 4px 10px;
    border-radius: 6px;
}

.anniv-badge {
    display: block;
    font-size: 0.8125rem;
    color: var(--text);
}

.anniv-years {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.text-muted {
    color: var(--text-muted);
}

.email-cell {
    color: var(--primary);
    font-size: 0.8125rem;
}

.date-cell {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.today-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--warning), #f97316);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.days-badge {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 6px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-secondary);
}

.action-btn:hover {
    border-color: transparent;
}

.action-edit:hover {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

.action-deactivate:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

.action-activate:hover {
    background: #d1fae5;
    color: #059669;
    border-color: #a7f3d0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    margin-bottom: 16px;
    font-size: 0.9375rem;
}

/* Form */
.form-container {
    max-width: 640px;
}

.form-card {
    background: var(--card);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text);
    font-size: 0.875rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    transition: var(--transition);
    background: #fff;
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.password-field {
    display: flex;
    gap: 8px;
    align-items: center;
}

.password-field input {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Login */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.login-body::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
}

.login-body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--card);
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #fff;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 0.875rem;
}

.login-form {
    text-align: left;
}

.btn-block {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    font-size: 0.9375rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .top-bar {
        flex-direction: column;
        gap: 12px;
    }

    .form-card {
        padding: 20px;
    }
}
