/* DEERO FITNESS - Modern UI, Pure CSS, No Bootstrap */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #14b8a6;
    --primary-50: #f0fdfa;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-50: #fffbeb;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --sidebar-bg: #1a2131;
    --sidebar-hover: rgba(255,255,255,0.06);
    --sidebar-active: rgba(20,184,166,0.15);
    --sidebar-text: rgba(248,250,252,0.85);
    --sidebar-text-active: #14b8a6;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --success-50: #ecfdf5;
    --danger: #ef4444;
    --danger-50: #fef2f2;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --card-gap: 1.25rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Icon base */
[data-lucide] {
    width: 1.25em;
    height: 1.25em;
    stroke-width: 2;
    flex-shrink: 0;
}

.btn [data-lucide],
.sidebar-nav [data-lucide] {
    width: 1.125em;
    height: 1.125em;
}

/* Login page - dark theme (gym-style): form left, image right */
.login-page {
    min-height: 100vh;
    padding: 0;
    background: #1a1a1a;
    background-attachment: fixed;
}

.login-wrap {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

.login-form-col {
    flex: 0 0 auto;
    width: 100%;
    max-width: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #1a1a1a;
}

.login-image-col {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(0,0,0,0.4);
}

.login-image-placeholder {
    background: rgba(15,23,42,0.6);
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
}

.login-image-placeholder .login-image-wrap {
    padding: 2rem;
    text-align: center;
}

.login-image-placeholder .login-placeholder-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.login-image-placeholder .login-placeholder-path {
    word-break: break-all;
    font-size: 0.8rem;
    margin: 0.5rem 0;
    color: var(--primary-light);
}

.login-image-placeholder p {
    margin: 0.35rem 0;
}

.login-image-wrap {
    position: relative;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 100vh;
    border-radius: 0;
    overflow: hidden;
    box-shadow: -12px 0 32px rgba(0,0,0,0.35);
}

.login-hero-img {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    max-height: 100vh;
    display: block;
    object-fit: cover;
    object-position: center 32%;
}

.login-hero-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        110deg,
        rgba(26, 33, 49, 0.52) 0%,
        rgba(26, 33, 49, 0.52) 38%,
        rgba(20, 184, 166, 0.18) 42%,
        rgba(234, 179, 8, 0.1) 50%,
        rgba(20, 184, 166, 0.18) 58%,
        rgba(26, 33, 49, 0.52) 62%,
        rgba(26, 33, 49, 0.52) 100%
    );
    background-size: 320% 100%;
    animation: loginOverlayShimmer 4.5s ease-in-out infinite;
}

@keyframes loginOverlayShimmer {
    0% { background-position: 100% 50%; }
    50% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dark gym-style login card */
.login-card-dark {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: #252525;
    border-radius: 12px;
    padding: 2.25rem 2rem;
    border: 1px solid #333;
    animation: slideUp 0.5s ease;
    overflow: hidden;
}

.login-logo-circle {
    width: 88px;
    height: 88px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #1a1a1a;
}

.login-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-logo-circle-icon {
    background: #eab308;
}

.login-card-dark .login-icon {
    width: 36px;
    height: 36px;
    color: #1a1a1a;
}

.login-brand {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
}

.login-welcome {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.15rem;
}

.login-tagline {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1.5rem;
}

.login-card-dark .login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-card-dark .login-form label {
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.login-card-dark .login-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid #444;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: #fff;
    font-family: inherit;
    transition: border-color var(--transition), background var(--transition);
}

.login-card-dark .login-form input::placeholder {
    color: #666;
}

.login-card-dark .login-form input:focus {
    outline: none;
    border-color: #eab308;
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 1px #eab308;
}

.btn-login-dark {
    width: 100%;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: #eab308;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.05em;
    border: none;
    border-radius: var(--radius-sm);
}

.btn-login-dark:hover {
    background: #facc15;
}

.login-card-dark .login-alert {
    background: rgba(239,68,68,0.2);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.4);
    margin-bottom: 1rem;
}

/* Legacy login card (kept for any non-dark use) */
.login-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent) 100%);
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header .login-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 0.75rem;
    color: var(--primary);
}

.login-header h1 {
    color: var(--text);
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.login-form .form-group {
    margin-bottom: 1.125rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.login-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.12);
}

.btn-block {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
}

.login-hint {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

@media (max-width: 992px) {
    .login-wrap {
        flex-direction: column;
    }
    .login-form-col {
        max-width: 100%;
        padding: 2rem 1.5rem;
    }
    .login-image-col {
        padding: 1.5rem;
        min-height: 40vh;
    }
    .login-image-wrap {
        max-width: 360px;
    }
}

@media (max-width: 576px) {
    .login-image-col {
        display: none;
    }
}

/* Layout - correct structure: sidebar + main content */
.app-wrap {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* Sidebar - collapsible / expandable */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-slow);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}

.app-wrap.sidebar-collapsed .sidebar {
    width: 72px;
}

.sidebar-brand {
    padding: 1.5rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 56px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.app-wrap.sidebar-collapsed .sidebar-brand {
    padding: 1rem;
    justify-content: center;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.app-wrap.sidebar-collapsed .sidebar-brand .sidebar-brand-text {
    display: none;
}

.sidebar-brand [data-lucide] {
    color: var(--primary-light);
    width: 1.5em;
    height: 1.5em;
    flex-shrink: 0;
}

.sidebar-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.75rem;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    transition: background var(--transition), color var(--transition);
}

.app-wrap.sidebar-collapsed .sidebar-nav a {
    justify-content: center;
    padding: 0.85rem;
}

.app-wrap.sidebar-collapsed .sidebar-nav a .nav-label {
    display: none;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.sidebar-nav a [data-lucide] {
    color: inherit;
    opacity: 0.9;
    flex-shrink: 0;
}

/* Main content - margin follows sidebar width, correct flex so content doesn't overflow */
.main-content {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
}

.app-wrap.sidebar-collapsed .main-content {
    margin-left: 72px;
}

/* Navbar - one row: toggle + title left, user + logout right */
.navbar {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    min-height: 56px;
    flex-shrink: 0;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 1rem;
    margin-right: 0.5rem;
    border-right: 1px solid var(--border);
}

.navbar-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.navbar-brand-text {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.navbar-page-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.navbar .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.navbar .sidebar-toggle:hover {
    background: var(--border);
    color: var(--primary);
}

.navbar h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-actions .user {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.content {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 1.5rem;
    max-width: 100%;
    background: var(--bg);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 1.5rem;
    margin-bottom: var(--card-gap);
    border: 1px solid var(--border);
    transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #e2e8f0;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--card-gap);
    margin-bottom: var(--card-gap);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.35rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.stat-card.primary {
    border-left: 4px solid var(--primary);
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--bg-card) 100%);
}

.stat-card.success {
    border-left: 4px solid var(--success);
    background: linear-gradient(135deg, var(--success-50) 0%, var(--bg-card) 100%);
}

.stat-card.danger {
    border-left: 4px solid var(--danger);
    background: linear-gradient(135deg, var(--danger-50) 0%, var(--bg-card) 100%);
}

.stat-card.accent {
    border-left: 4px solid var(--accent);
    background: linear-gradient(135deg, var(--accent-50) 0%, var(--bg-card) 100%);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(13,148,136,0.35);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-accent:hover {
    background: var(--accent-light);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    filter: brightness(1.08);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    filter: brightness(1.08);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-sm [data-lucide] {
    width: 1em;
    height: 1em;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.12);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

/* Tables - alignment: each line as one row */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

table.data-table th,
table.data-table td {
    padding: 0.85rem 1.1rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

table.data-table tr {
    display: table-row;
}

table.data-table th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

table.data-table tbody tr {
    transition: background var(--transition);
}

table.data-table tbody tr:hover td {
    background: rgba(0,0,0,0.03);
}

table.data-table tbody tr:last-child td {
    border-bottom: 1px solid var(--border);
}

table.data-table td {
    line-height: 1.4;
}

table.data-table .btn-sm + .btn-sm {
    margin-left: 0.35rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
}

.badge-success {
    background: var(--success-50);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-50);
    color: var(--danger);
}

.remaining-days { font-weight: 600; }
.remaining-green { color: #059669; }
.remaining-orange { color: #d97706; }
.remaining-red { color: #dc2626; }
.remaining-zero { color: #64748b; }

/* Members table – alignment and style */
.members-card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    overflow: hidden;
}
.members-card .table-wrap {
    border-radius: 0 0 var(--radius) var(--radius);
}
.members-table th {
    background: var(--primary);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 1rem 1.1rem;
    border-bottom: 2px solid var(--primary-dark);
}
.members-table td {
    padding: 1rem 1.1rem;
    vertical-align: middle;
}
.members-table tbody tr {
    border-bottom: 1px solid var(--border);
}
.members-table tbody tr:last-child {
    border-bottom: none;
}
.members-table tbody tr:hover td {
    background: rgba(0,0,0,0.02);
}
/* Column alignment */
.members-table .col-id { width: 4rem; text-align: center; }
.members-table .col-name { min-width: 140px; }
.members-table .col-status { width: 7rem; text-align: center; }
.members-table .col-days { width: 6rem; text-align: center; }
.members-table .col-fee { width: 6rem; text-align: right; font-variant-numeric: tabular-nums; }
.members-table .col-dates { min-width: 180px; font-variant-numeric: tabular-nums; }
.members-table .col-actions { text-align: right; white-space: nowrap; }
.members-table .actions-cell .btn-sm {
    margin-left: 0.35rem;
    margin-bottom: 0.25rem;
}
.members-table .actions-cell .btn-sm:first-child {
    margin-left: 0;
}
@media (max-width: 900px) {
    .members-table .col-actions { white-space: normal; }
    .members-table .actions-cell { justify-content: flex-start; }
}

/* Readonly form fields (Mark Paid confirmation) */
.form-control-readonly {
    background: var(--bg);
    color: var(--text);
    cursor: default;
}
.form-mark-paid-intro {
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--primary-50);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text);
}
.modal-mark-paid .modal-body { padding: 1.25rem 1.5rem; }
.modal-mark-paid .modal-footer .btn-success { min-width: 140px; }

.modal-invoice .invoice-print { padding: 0.5rem 0; }
.invoice-gym { font-size: 1.5rem; margin-bottom: 0.25rem; }
.invoice-number { font-weight: 600; color: var(--text-muted); margin-bottom: 1rem; }
.invoice-table { width: 100%; border-collapse: collapse; }
.invoice-table th { text-align: left; padding: 0.35rem 0.5rem 0.35rem 0; color: var(--text-muted); width: 140px; }
.invoice-table td { padding: 0.35rem 0; }
@media print {
    body * { visibility: hidden; }
    .modal-overlay#invoiceModal, .modal-overlay#invoiceModal * { visibility: visible; }
    .modal-overlay#invoiceModal { position: absolute; left: 0; top: 0; width: 100%; }
    .no-print { display: none !important; }
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: slideUp 0.3s ease;
    border: 1px solid transparent;
}

.alert-error {
    background: var(--danger-50);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert .import-errors { font-size: 0.8rem; margin-top: 0.5rem; white-space: pre-wrap; color: inherit; opacity: 0.9; }

.alert-success {
    background: var(--success-50);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.25);
}

/* Filters card - date range & filters (reference style) */
.filters-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 1.5rem;
    position: relative;
}

.filters-card::before {
    content: none;
}

.filters-card .card-title {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-end;
    margin-bottom: 0;
}

.filters-card .filters-bar {
    margin-bottom: 0;
}

.filters-bar .form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.filters-bar label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.filters-bar .form-control {
    height: 42px;
    min-height: 42px;
    padding: 0 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}

.filters-bar .form-control[type="number"] {
    background-image: none;
    padding-right: 1rem;
}

.filters-bar .form-control[type="date"] {
    background-image: none;
    padding-right: 2.25rem;
    min-width: 172px;
    width: 172px;
}

.filters-bar select.form-control {
    cursor: pointer;
}

.filters-bar .form-control:hover {
    border-color: #cbd5e1;
}

.filters-bar .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
    outline: none;
}

.filters-bar .form-control::placeholder {
    color: #94a3b8;
}

.filters-bar .btn-primary {
    height: 42px;
    min-height: 42px;
    padding: 0 1.35rem;
    align-self: flex-end;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--primary);
    color: #fff;
    border: none;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.filters-bar .btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(13,148,136,0.35);
}

.filters-bar .btn {
    height: 42px;
    min-height: 42px;
    padding: 0 1.35rem;
    align-self: flex-end;
    border-radius: 10px;
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15,23,42,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    padding: 0.35rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal-close [data-lucide] {
    width: 1.25rem;
    height: 1.25rem;
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Members filter form */
.members-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}
.members-filter-form .filter-status-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.members-filter-form .filter-status-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    margin: 0;
}
.members-filter-form .form-control,
.members-filter-form .form-control-sm {
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.members-filter-form .form-control-sm {
    min-width: 100px;
}
.members-filter-form .form-control {
    width: 220px;
}
.members-header-actions > a:first-of-type {
    margin-left: 0.25rem;
}
.members-filter-form .btn {
    height: 2.25rem;
    padding: 0.4rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.page-header .navbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}
.page-header .navbar-actions .btn {
    height: 2.25rem;
    padding: 0.4rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.page-header .navbar-actions .btn-primary {
    height: 2.25rem;
}

/* Page header */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Charts grid - same gap as stats for uniform spacing */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--card-gap);
    margin-bottom: var(--card-gap);
}

.chart-card {
    margin-bottom: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.chart-card .chart-wrap {
    position: relative;
    height: 220px;
    width: 100%;
}

.chart-wrap-center {
    max-width: 280px;
    margin: 0 auto;
}

.text-muted { color: var(--text-muted); }

.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mb-0 { margin-bottom: 0; }

/* Responsive - correct layout at each breakpoint */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        box-shadow: none;
    }

    .sidebar.open-mobile {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 99;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .app-wrap.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
    }

    .app-wrap.sidebar-collapsed .sidebar.open-mobile {
        transform: translateX(0);
    }

    .content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .navbar {
        padding: 0.75rem 1rem;
    }

    table.data-table th,
    table.data-table td {
        padding: 0.65rem 0.85rem;
        font-size: 0.85rem;
    }
}
