/* ============================================================
   IK404 — Design System
   Minimalis Modern · Inspired by Notion, Linear, Vercel
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
    /* Colors — Light Mode */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9fafb;
    --bg-hover: #f3f4f6;
    --bg-active: #e5e7eb;
    --bg-sidebar: #ffffff;

    --text-primary: #111827;
    --text-secondary: #3f3f46;
    --text-muted: #6b7280;
    --text-inverse: #ffffff;

    --border: #e5e7eb;
    --border-light: #f0f0f0;

    --accent: #10b981;
    --accent-hover: #059669;
    --accent-light: #d1fae5;
    --accent-text: #065f46;

    --blue: #3b82f6;
    --blue-light: #dbeafe;
    --amber: #f59e0b;
    --amber-light: #fef3c7;
    --red: #ef4444;
    --red-light: #fee2e2;
    --green: #22c55e;
    --green-light: #dcfce7;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed: 64px;

    /* Font */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-xs: 12px;
    --font-sm: 13px;
    --font-base: 14px;
    --font-md: 16px;
    --font-lg: 20px;
    --font-xl: 24px;
    --font-2xl: 28px;

    color-scheme: light dark;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-tertiary: #1c1c1f;
    --bg-hover: #27272a;
    --bg-active: #3f3f46;
    --bg-sidebar: #09090b;

    --text-primary: #fafafa;
    --text-secondary: #e4e4e7;
    --text-muted: #a1a1aa;
    --text-inverse: #09090b;

    --border: #27272a;
    --border-light: #1e1e21;

    --accent: #34d399;
    --accent-hover: #10b981;
    --accent-light: #064e3b;
    --accent-text: #6ee7b7;

    --blue-light: #1e3a5f;
    --amber-light: #451a03;
    --red-light: #450a0a;
    --green-light: #052e16;
    --purple-light: #2e1065;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-base);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    display: block;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: var(--font-2xl); font-weight: 700; }
h2 { font-size: var(--font-xl); }
h3 { font-size: var(--font-lg); }
h4 { font-size: var(--font-md); }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: var(--font-sm); }
.text-xs { font-size: var(--font-xs); }

/* ============================================================
   LAYOUT — SIDEBAR + MAIN
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.sidebar-brand .brand-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: var(--font-sm);
}

.sidebar-brand .brand-text {
    font-weight: 700;
    font-size: var(--font-md);
    color: var(--text-primary);
}

.sidebar-brand .brand-sub {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 400;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md) var(--space-sm);
}

.nav-section {
    margin-bottom: var(--space-lg);
}

.nav-section-title {
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-xs) var(--space-md);
    margin-bottom: var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-hover);
    color: var(--accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-item svg,
.nav-item .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg,
.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-light);
    color: var(--accent-text);
    font-size: var(--font-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-light);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--font-sm);
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info .user-name {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .user-role {
    font-size: var(--font-xs);
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.page-header {
    padding: var(--space-lg) var(--space-2xl);
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-title-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.page-header h1 {
    font-size: var(--font-lg);
    font-weight: 600;
}

.page-header .page-subtitle {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: 2px;
}

.page-body {
    padding: var(--space-2xl);
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: border-color var(--transition-fast);
}

.card:hover {
    border-color: var(--border);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.card-title {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--text-primary);
}

/* Stat Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

@media (max-width: 640px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
        margin-bottom: var(--space-lg);
    }
    .stat-card {
        padding: var(--space-md) var(--space-sm) !important;
        gap: var(--space-sm) !important;
        align-items: center !important;
    }
    .stat-icon {
        width: 32px !important;
        height: 32px !important;
    }
    .stat-icon svg {
        width: 16px !important;
        height: 16px !important;
    }
    .stat-content .stat-value {
        font-size: var(--font-md) !important;
    }
    .stat-content .stat-label {
        font-size: var(--font-xs) !important;
        margin-top: 0 !important;
    }
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    transition: border-color var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--accent);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.emerald { background: var(--accent-light); color: var(--accent); }
.stat-icon.blue { background: var(--blue-light); color: var(--blue); }
.stat-icon.amber { background: var(--amber-light); color: var(--amber); }
.stat-icon.red { background: var(--red-light); color: var(--red); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }

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

.stat-content .stat-label {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.5;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: var(--space-xs) var(--space-sm);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-danger {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-xs);
}

.btn-lg {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-base);
}

.btn-block {
    width: 100%;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-base);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

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

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.form-error {
    font-size: var(--font-xs);
    color: var(--red);
    margin-top: var(--space-xs);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

/* Checkbox */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    padding: var(--space-md) var(--space-md);
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
    white-space: nowrap;
}

tbody td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    font-size: var(--font-sm);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--bg-hover);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: var(--font-xs);
    font-weight: 500;
    white-space: nowrap;
}

.badge-success { background: var(--green-light); color: var(--green); }
.badge-warning { background: var(--amber-light); color: var(--amber); }
.badge-danger { background: var(--red-light); color: var(--red); }
.badge-info { background: var(--blue-light); color: var(--blue); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-default { background: var(--bg-hover); color: var(--text-secondary); }

/* Priority dots */
.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.priority-dot.urgent { background: var(--red); }
.priority-dot.normal { background: var(--amber); }
.priority-dot.low { background: var(--text-muted); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: var(--font-md);
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-light);
}

/* ============================================================
   KANBAN BOARD
   ============================================================ */
.kanban-board {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding-bottom: var(--space-md);
    min-height: 60vh;
}

.kanban-column {
    min-width: 280px;
    max-width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-xs);
    margin-bottom: var(--space-sm);
}

.kanban-column-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.kanban-count {
    font-size: var(--font-xs);
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.kanban-column-body {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    transition: background var(--transition-fast);
}

.kanban-column-body.drag-over {
    background: var(--accent-light);
    border-color: var(--accent);
}

.kanban-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    cursor: grab;
    transition: all var(--transition-fast);
    user-select: none;
}

.kanban-card:hover {
    border-color: var(--accent);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.kanban-card-title {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.kanban-card-assignee {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.kanban-card-assignee .mini-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
}

.kanban-card-deadline {
    font-size: var(--font-xs);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

.kanban-card-deadline.overdue {
    color: var(--red);
    font-weight: 500;
}

.kanban-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: var(--font-sm);
    cursor: pointer;
    background: transparent;
    width: 100%;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.kanban-add-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* ============================================================
   MUTABAAH GRID
   ============================================================ */
.mutabaah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-md);
}

.mutabaah-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mutabaah-item:hover {
    border-color: var(--accent);
}

.mutabaah-item.checked {
    background: var(--accent-light);
    border-color: var(--accent);
}

.mutabaah-item .mutabaah-icon {
    font-size: 24px;
    margin-bottom: var(--space-sm);
}

.mutabaah-item .mutabaah-label {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.mutabaah-item .mutabaah-check {
    margin-top: var(--space-sm);
    color: var(--accent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.mutabaah-item.checked .mutabaah-check {
    opacity: 1;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.w-full { width: 100%; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    opacity: 0.4;
}

.empty-state p {
    font-size: var(--font-sm);
    margin-top: var(--space-sm);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 280px;
    animation: slideIn 0.3s ease;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--amber); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: var(--bg-primary);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-header .login-icon {
    width: 140px;
    height: 140px;
    background: var(--accent);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    color: white;
    font-weight: 700;
    font-size: var(--font-lg);
}

.login-header h1 {
    font-size: var(--font-xl);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.login-header p {
    color: var(--text-muted);
    font-size: var(--font-sm);
}

.login-error {
    background: var(--red-light);
    color: var(--red);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    margin-bottom: var(--space-md);
    display: none;
}

.login-theme-wrapper {
    text-align: center;
    margin-top: var(--space-xl);
}

.login-theme-toggle {
    font-size: var(--font-sm);
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.login-theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.login-theme-icon {
    vertical-align: middle;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.sidebar-theme-toggle {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 16px;
    margin-bottom: 8px;
}

/* ============================================================
   REUSABLE COMPONENT CLASSES
   ============================================================ */

/* --- List Items --- */
.list-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.list-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.list-row:hover {
    background: var(--bg-hover);
}

.list-row-body {
    flex: 1;
    min-width: 0;
}

.list-row-title {
    font-size: var(--font-sm);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-row-sub {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

/* --- Date Tile --- */
.date-tile {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
}

.date-tile-lg {
    width: 48px;
    height: 48px;
    border-radius: 10px;
}

.date-tile-day {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.date-tile-lg .date-tile-day {
    font-size: 14px;
}

.date-tile-month {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.date-tile-lg .date-tile-month {
    font-size: 10px;
}

/* --- Mini Avatar --- */
.mini-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.mini-avatar-sm {
    width: 20px;
    height: 20px;
}

.mini-avatar-md {
    width: 24px;
    height: 24px;
}

.mini-avatar-lg {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.mini-avatar-xl {
    width: 44px;
    height: 44px;
    font-size: 16px;
    font-weight: 700;
}

/* --- Tilawah Counter --- */
.tilawah-counter {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.tilawah-display {
    text-align: center;
}

.tilawah-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
}

/* --- Finance Summary --- */
.finance-hero {
    display: flex;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.finance-balance {
    font-size: var(--font-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.finance-row {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
}

.finance-income {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--green);
}

.finance-expense {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--red);
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.filter-label {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

/* --- Date Navigation --- */
.date-nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.date-nav-label {
    font-weight: 500;
}

/* --- Inline Forms --- */
.form-inline {
    width: auto;
}

.form-compact {
    padding: 6px 12px;
    font-size: var(--font-sm);
}

.form-group-flush {
    margin: 0;
}

/* --- Attendance Row --- */
.attendance-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.attendance-name {
    flex: 1;
    font-size: var(--font-sm);
    font-weight: 500;
}

.attendance-select {
    width: auto;
    padding: 4px 8px;
    font-size: var(--font-xs);
}

.attendance-note {
    width: 120px;
    padding: 4px 8px;
    font-size: var(--font-xs);
}

/* --- Member Card --- */
.member-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.member-card-info {
    flex: 1;
    min-width: 0;
}

.member-card-name {
    font-weight: 600;
    font-size: 15px;
}

.member-card-stats {
    display: flex;
    gap: var(--space-md);
}

.member-stat {
    text-align: center;
    flex: 1;
}

.member-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* --- Material Card --- */
.material-card {
    padding: var(--space-lg);
}

.material-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.material-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.material-content {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 120px;
    overflow: hidden;
}

.material-content a {
    word-break: break-all;
}

/* --- Meeting Card --- */
.meeting-card {
    padding: var(--space-md);
    cursor: pointer;
}

.meeting-card-inner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.meeting-card-actions {
    display: flex;
    gap: var(--space-xs);
}

/* --- Card Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-md);
}

/* --- Task Detail --- */
.task-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.task-detail-field {
    /* Individual field in task detail */
}

.task-detail-field-label {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.task-detail-desc {
    margin-bottom: var(--space-md);
}

.task-detail-desc p {
    line-height: 1.6;
    color: var(--text-secondary);
}

/* --- Comments --- */
.comments-section {
    border-top: 1px solid var(--border-light);
    padding-top: var(--space-md);
    margin-top: var(--space-sm);
}

.comments-title {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.comment-item {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.comment-author {
    font-size: var(--font-xs);
}

.comment-author strong {
    font-weight: 600;
}

.comment-time {
    color: var(--text-muted);
    font-size: 11px;
}

.comment-text {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

.comment-input-row {
    display: flex;
    gap: var(--space-sm);
}

/* --- Task Actions --- */
.task-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
}

/* --- Kanban Card Internals --- */
.kanban-card-priority {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--space-sm);
}

.kanban-card-priority-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.kanban-card-meta-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.kanban-comment-count {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 2px;
}

/* --- Color Utilities --- */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-accent { color: var(--accent); }
.text-blue { color: var(--blue); }
.text-amber { color: var(--amber); }

/* --- Additional Spacing & Layout Utilities --- */
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mt-xl { margin-top: var(--space-xl); }
.mb-xl { margin-bottom: var(--space-xl); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.p-sm { padding: var(--space-sm); }
.p-xs { padding: var(--space-xs); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-medium { font-weight: 500; }
.text-semibold { font-weight: 600; }
.text-bold { font-weight: 700; }
.flex-1 { flex: 1; min-width: 0; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.break-all { word-break: break-all; }
.gap-xl { gap: var(--space-xl); }
.loading-center { text-align: center; padding: 40px; }
.w-auto { width: auto; }
.w-60 { width: 60px; }
.form-select-sm { padding: 6px 12px; font-size: var(--font-sm); }

/* --- Empty State Compact --- */
.empty-state-sm {
    padding: var(--space-xl) var(--space-md);
}

/* --- Modal Wide --- */
.modal-wide {
    max-width: 560px;
}

.modal-wider {
    max-width: 600px;
}

/* --- Badge Tiny --- */
.badge-tiny {
    font-size: 10px;
}

/* --- Table borderless wrapper --- */
.table-wrapper-flush {
    border: none;
}
/* --- Member Card Components --- */
.member-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-md);
}

.member-card-info {
    flex: 1;
    min-width: 0;
}

.member-card-name {
    font-weight: 600;
    font-size: 15px;
}

.member-card-actions {
    display: flex;
    gap: 2px;
}

.member-card-stats {
    display: flex;
    gap: var(--space-md);
}

.member-stat-col {
    text-align: center;
    flex: 1;
}

.member-stat-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .page-body {
        padding: var(--space-md);
    }

    .page-header {
        padding: var(--space-md);
    }

    .card {
        padding: var(--space-md) !important;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #financeSummary .stat-card:first-child {
        grid-column: span 2 !important;
    }

    .kanban-board {
        flex-direction: column;
    }

    .kanban-column {
        min-width: 100%;
        max-width: 100%;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .mutabaah-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal {
        max-width: 100%;
        margin: var(--space-md);
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

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

    .login-card {
        padding: var(--space-lg);
    }

    .modal-header, .modal-body, .modal-footer {
        padding: var(--space-md) !important;
    }

    .modal-footer {
        flex-direction: column-reverse !important;
        align-items: stretch !important;
        gap: var(--space-sm) !important;
    }

    .modal-footer .btn {
        width: 100% !important;
    }
}

/* ============================================================
   MODERN AUTH EXTRAS (Remember Me & Forgot Password)
   ============================================================ */

/* Ambient Glow Backgrounds */
.login-ambient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.glow-1, .glow-2 {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    transition: background var(--transition-normal);
}

/* Light theme glows */
.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}

.glow-2 {
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--blue) 0%, transparent 70%);
}

/* Dark theme overrides for glows */
[data-theme="dark"] .glow-1 {
    opacity: 0.25;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, transparent 70%);
}

[data-theme="dark"] .glow-2 {
    opacity: 0.15;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 70%);
}

/* Glassmorphism card enhancements */
.login-card {
    position: relative;
    z-index: 10;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.75);
    transition: all var(--transition-normal);
}

[data-theme="dark"] .login-card {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(24, 24, 27, 0.75);
}

/* Premium input focus state */
.form-input {
    transition: all var(--transition-fast);
}

.form-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08), 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* Links & Text Hover styling */
.hover-underline {
    position: relative;
}
.hover-underline::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent);
    transform-origin: bottom right;
    transition: transform var(--transition-fast) ease-out;
}
.hover-underline:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Password Strength Indicator */
.pwd-strength-container {
    height: 4px;
    width: 100%;
    background: var(--bg-hover);
    border-radius: 2px;
    overflow: hidden;
}

.pwd-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
}

.pwd-strength-bar.weak {
    background: var(--red);
}

.pwd-strength-bar.medium {
    background: var(--amber);
}

.pwd-strength-bar.strong {
    background: var(--green);
}

/* Success Card Block */
.success-block {
    text-align: center;
    padding: var(--space-md) 0;
    animation: fadeIn 0.4s ease-out;
}

.success-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .success-icon-wrapper {
    background: rgba(16, 185, 129, 0.15);
}

.success-title {
    font-size: var(--font-lg);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.success-desc {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    line-height: 1.5;
}

/* Dev Mode helper block */
.dev-alert {
    background: var(--bg-tertiary);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.dev-tag {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent-text);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.dev-alert p {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   AL-QUR'AN DIGITAL STYLES
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;600;700&family=Scheherazade+New:wght@400;700&display=swap');

.quran-container {
    animation: fadeIn 0.4s ease-out;
}

/* Surah Search & Filter */
.quran-header-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.search-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.quran-search-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-sm);
    transition: all var(--transition-fast);
}

.quran-search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* iOS-Style Toggle Switch */
.ios-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: var(--space-sm);
    user-select: none;
    font-weight: 500;
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-switch-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 99px;
    transition: background-color 0.2s, border-color 0.2s;
}

.ios-switch-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

input:checked + .ios-switch-slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

input:checked + .ios-switch-slider:before {
    transform: translateX(20px);
}

[data-theme="dark"] .ios-switch-slider:before {
    background-color: #f4f4f5;
}

/* Surah Grid */
.surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.surah-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
    text-align: left;
}

.surah-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.surah-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-text);
    font-weight: 700;
    font-size: var(--font-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme="dark"] .surah-badge {
    background: rgba(16, 185, 129, 0.15);
}

.surah-details {
    flex: 1;
    min-width: 0;
}

.surah-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.surah-name-id {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.surah-name-ar {
    font-family: 'Amiri', serif;
    font-size: var(--font-md);
    color: var(--accent);
    font-weight: 700;
}

.surah-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

/* Reader View styling */
.reader-back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: var(--font-sm);
    cursor: pointer;
    margin-bottom: var(--space-md);
    transition: color var(--transition-fast);
}

.reader-back-btn:hover {
    color: var(--accent);
}

.reader-header {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.reader-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--accent), var(--blue));
}

.reader-header h2 {
    font-size: var(--font-2xl);
    margin-bottom: var(--space-xs);
}

.reader-header .surah-origin {
    font-size: var(--font-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.bismillah {
    font-family: 'Noto Naskh Arabic', 'Scheherazade New', serif;
    font-size: 32px;
    color: var(--text-primary);
    margin: var(--space-md) auto 0;
    direction: rtl;
}

.verse-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.verse-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    position: relative;
}

.verse-card:hover {
    border-color: var(--accent-light);
    box-shadow: var(--shadow-md);
}

.verse-card.playing {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.02);
}

[data-theme="dark"] .verse-card.playing {
    background: rgba(16, 185, 129, 0.05);
}

.verse-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: var(--space-sm);
}

.verse-number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: var(--font-xs);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 99px;
}

.verse-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.verse-control-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.verse-control-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.verse-control-btn.active {
    color: var(--accent);
    background: var(--accent-light);
}

[data-theme="dark"] .verse-control-btn.active {
    background: rgba(16, 185, 129, 0.2);
}

.verse-arabic {
    font-family: 'Noto Naskh Arabic', 'Scheherazade New', serif;
    font-size: 28px;
    line-height: 2.2;
    text-align: right;
    direction: rtl;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    word-wrap: break-word;
    user-select: none;
}

.verse-translation {
    font-size: var(--font-base);
    color: var(--text-secondary);
    line-height: 1.6;
    transition: opacity 0.3s ease, height 0.3s ease;
    border-left: 2px solid var(--accent);
    padding-left: var(--space-md);
    margin-top: var(--space-sm);
}

.verse-translation.hidden {
    display: none !important;
}

/* Floating Action Button for Bookmark */
.bookmark-floating-btn {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 0);
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: var(--font-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    cursor: pointer;
    z-index: 99;
    transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
    animation: slideUpCenter 0.3s ease-out;
}

.bookmark-floating-btn:hover {
    background: var(--accent-hover);
    transform: translate(-50%, -3px);
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.4);
}

.bookmark-floating-btn svg {
    flex-shrink: 0;
}

@keyframes slideUpCenter {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Loading Spinner */
.quran-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl) 0;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MUSHAF PAGE MODE STYLES
   ============================================================ */
.quran-segmented-control {
    display: flex;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 3px;
    align-self: flex-start;
}

.segmented-btn {
    border: none;
    background: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--font-sm);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.segmented-btn:hover {
    color: var(--text-primary);
}

.segmented-btn.active {
    background: var(--bg-secondary);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.juz-accordion-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.juz-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-fast);
}

.juz-item:hover {
    border-color: var(--accent-light);
}

.juz-header {
    padding: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    background: var(--bg-secondary);
    transition: background var(--transition-fast);
}

.juz-header:hover {
    background: var(--bg-hover);
}

.juz-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-base);
}

.juz-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.juz-chevron {
    transition: transform var(--transition-normal);
    color: var(--text-muted);
}

.juz-item.open .juz-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.juz-content {
    display: none;
    padding: var(--space-md);
    border-top: 1px solid var(--border-light);
    background: var(--bg-tertiary);
}

.juz-item.open .juz-content {
    display: block;
    animation: slideDownFade 0.2s ease-out;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: var(--space-xs);
}

.page-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: var(--font-xs);
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

[data-theme="dark"] .page-btn:hover {
    background: rgba(16, 185, 129, 0.15);
}

.reader-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-top: var(--space-xl);
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease-out;
}

.pagination-info {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-sm);
}

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MOBILE CARD LIST (Responsive Tables)
   ============================================================ */
@media (max-width: 640px) {
    .mobile-card-list table, 
    .mobile-card-list thead, 
    .mobile-card-list tbody, 
    .mobile-card-list th, 
    .mobile-card-list td, 
    .mobile-card-list tr { 
        display: block !important; 
    }
    
    .mobile-card-list thead tr { 
        position: absolute !important;
        top: -9999px !important;
        left: -9999px !important;
    }
    
    .mobile-card-list tr {
        border-bottom: 1px solid var(--border) !important;
        padding: var(--space-md) 130px var(--space-md) var(--space-sm) !important;
        position: relative !important;
        background: var(--bg-secondary) !important;
        margin-bottom: 0 !important;
    }
    
    .mobile-card-list td { 
        border: none !important;
        padding: 2px 0 !important;
        position: relative !important;
        text-align: left !important;
        background: transparent !important;
    }
    
    /* 1. Date (top-left, inline, muted) */
    .mobile-card-list td:nth-of-type(1) {
        font-size: var(--font-xs) !important;
        color: var(--text-muted) !important;
        display: inline-block !important;
        margin-right: var(--space-xs) !important;
    }
    
    /* 2. Member Name (top-left, inline, muted, preceded by a dot) */
    .mobile-card-list td:nth-of-type(3) {
        font-size: var(--font-xs) !important;
        color: var(--text-muted) !important;
        display: inline-block !important;
    }
    
    .mobile-card-list td:nth-of-type(3)::before {
        content: "· " !important;
        font-weight: 700 !important;
    }
    
    /* 3. Description (middle, large, bold primary) */
    .mobile-card-list td:nth-of-type(2) {
        font-size: var(--font-sm) !important;
        font-weight: 600 !important;
        color: var(--text-primary) !important;
        margin-top: 4px !important;
        margin-bottom: 2px !important;
        display: block !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
    
    /* 4. Amount (floated top-right, large, colored) */
    .mobile-card-list td:nth-of-type(4) {
        position: absolute !important;
        top: var(--space-md) !important;
        right: var(--space-sm) !important;
        font-size: var(--font-base) !important;
        font-weight: 700 !important;
        display: block !important;
    }
    
    /* 5. Delete Action button (floated bottom-right) */
    .mobile-card-list td:nth-of-type(5) {
        position: absolute !important;
        bottom: 8px !important;
        right: var(--space-sm) !important;
        display: block !important;
        padding: 0 !important;
    }
    
    /* Extra padding inside transaction list card-body if managed */
    .mobile-card-list td:nth-of-type(5) .btn-ghost {
        padding: 4px !important;
    }
}

/* ============================================================
   STATUS IURAN CARD (For regular members)
   ============================================================ */
.status-iuran-card {
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: border-color var(--transition-fast);
}

.status-iuran-card:hover {
    border-color: var(--border);
}

.status-alert {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast) ease;
}

.status-alert:hover {
    box-shadow: var(--shadow-md);
}

.status-alert.success-box {
    border: 1px solid rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.04);
}

[data-theme="dark"] .status-alert.success-box {
    border-color: rgba(52, 211, 153, 0.25);
    background: rgba(52, 211, 153, 0.06);
}

.status-alert.warning-box {
    border: 1px solid rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.04);
}

[data-theme="dark"] .status-alert.warning-box {
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.06);
}

.status-alert.danger-box {
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.04);
}

[data-theme="dark"] .status-alert.danger-box {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.06);
}

.status-alert-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    transition: all var(--transition-fast) ease;
}

.status-alert.success-box .status-alert-icon {
    color: var(--green);
    background: rgba(34, 197, 94, 0.1);
}

[data-theme="dark"] .status-alert.success-box .status-alert-icon {
    color: #34d399;
    background: rgba(52, 211, 153, 0.15);
}

.status-alert.warning-box .status-alert-icon {
    color: var(--amber);
    background: rgba(245, 158, 11, 0.1);
}

[data-theme="dark"] .status-alert.warning-box .status-alert-icon {
    color: var(--amber);
    background: rgba(245, 158, 11, 0.15);
}

.status-alert.danger-box .status-alert-icon {
    color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .status-alert.danger-box .status-alert-icon {
    color: var(--red);
    background: rgba(239, 68, 68, 0.15);
}

.status-alert-title {
    font-size: var(--font-md);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.status-alert-desc {
    font-size: var(--font-base);
    color: var(--text-secondary);
    line-height: 1.6;
}

.status-alert-hint {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: var(--space-sm);
    line-height: 1.5;
}

.iuran-details {
    margin-top: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    border-top: 1px dashed var(--border);
    padding-top: var(--space-md);
}

.iuran-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-sm);
    padding: var(--space-xs) 0;
}

.iuran-detail-item .label {
    color: var(--text-muted);
    font-weight: 500;
}

.iuran-detail-item .value {
    color: var(--text-primary);
    font-weight: 600;
}

@media (max-width: 480px) {
    .status-alert {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
        padding: var(--space-md);
    }
}

/* ============================================================
   QURAN QUOTE CARD
   ============================================================ */
.quran-quote-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    overflow: hidden;
}

.quran-quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.quran-quote-body {
    transition: opacity 0.25s ease;
}

.quran-quote-arabic {
    font-family: 'Noto Naskh Arabic', 'Scheherazade New', serif;
    font-size: 24px;
    line-height: 2;
    text-align: right;
    direction: rtl;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    word-wrap: break-word;
}

.quran-quote-translation {
    font-size: var(--font-base);
    color: var(--text-secondary);
    line-height: 1.6;
    border-left: 2px solid var(--accent);
    padding-left: var(--space-md);
    margin-bottom: var(--space-sm);
    font-style: italic;
}

.quran-quote-reference {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 600;
    text-align: right;
}

.quran-refresh-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.quran-refresh-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

/* ============================================================
   RESPONSIVE FINANCE HERO (For Dashboard)
   ============================================================ */
@media (max-width: 768px) {
    .finance-hero {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: var(--space-md) !important;
        text-align: center !important;
    }
    
    .finance-hero > div:first-child {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .finance-balance {
        font-size: var(--font-xl) !important;
    }

    .finance-row {
        justify-content: center !important;
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: var(--space-sm) !important;
    }
    
    .finance-row > div {
        background: var(--bg-tertiary) !important;
        padding: var(--space-sm) !important;
        border-radius: var(--radius-md) !important;
        border: 1px solid var(--border-light) !important;
        text-align: center !important;
    }
}

/* ============================================================
   DASHBOARD MENU CARDS GRID
   ============================================================ */
.menu-grid-container {
    margin-bottom: var(--space-xl);
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: var(--space-md);
}

.menu-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    transition: all var(--transition-normal);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
}

.menu-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    background: var(--bg-hover);
}

.menu-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.menu-card:hover .menu-icon {
    transform: scale(1.08);
}

.menu-icon.emerald { background: var(--accent-light); color: var(--accent); }
.menu-icon.blue { background: var(--blue-light); color: var(--blue); }
.menu-icon.amber { background: var(--amber-light); color: var(--amber); }
.menu-icon.purple { background: var(--purple-light); color: var(--purple); }
.menu-icon.red { background: var(--red-light); color: var(--red); }
.menu-icon.teal { background: #e0f2fe; color: #0284c7; }

[data-theme="dark"] .menu-icon.teal {
    background: rgba(2, 132, 199, 0.15);
}

.menu-content {
    flex: 1;
    min-width: 0;
}

.menu-title {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.menu-desc {
    font-size: var(--font-xs);
    color: var(--text-muted);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .menu-grid {
        grid-template-columns: 1fr !important;
        gap: var(--space-sm);
    }
}

/* ============================================================
   MOBILE RESPONSIVE CUSTOM OPTIMIZATIONS
   ============================================================ */
.show-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    .show-mobile {
        display: block !important;
    }

    /* Optimization for Tasks list row */
    .tasks-card .list-row {
        display: grid !important;
        grid-template-columns: auto 1fr !important;
        grid-template-rows: auto auto !important;
        gap: 6px var(--space-sm) !important;
        align-items: center !important;
        padding: var(--space-sm) 0 !important;
    }

    .tasks-card .priority-dot {
        grid-column: 1 !important;
        grid-row: 1 !important;
        align-self: center !important;
        margin: 0 !important;
    }

    .tasks-card .list-row-body {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    .tasks-card .list-row-title {
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.3 !important;
    }

    .tasks-card .badge {
        grid-column: 2 !important;
        grid-row: 2 !important;
        justify-self: start !important;
        margin: 0 !important;
    }

    .tasks-card .mini-avatar {
        grid-column: 2 !important;
        grid-row: 2 !important;
        justify-self: end !important;
        margin: 0 !important;
    }

    /* Optimization for Meetings list row */
    .meetings-card .list-row {
        display: grid !important;
        grid-template-columns: auto 1fr !important;
        grid-template-rows: auto auto !important;
        gap: 6px var(--space-sm) !important;
        align-items: center !important;
        padding: var(--space-sm) 0 !important;
    }

    .meetings-card .date-tile {
        grid-column: 1 !important;
        grid-row: 1 / span 2 !important;
        align-self: center !important;
    }

    .meetings-card .list-row-body {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    .meetings-card .list-row-title {
        white-space: normal !important;
        word-break: break-word !important;
        line-height: 1.3 !important;
    }

    .meetings-card .badge {
        grid-column: 2 !important;
        grid-row: 2 !important;
        justify-self: start !important;
        margin: 0 !important;
        width: fit-content !important;
    }

    /* Helper classes for mobile */
    .flex-mobile-full {
        width: 100% !important;
        justify-content: space-between !important;
        display: flex !important;
    }

    .justify-center-mobile {
        justify-content: center !important;
        width: 100% !important;
    }

    /* Make filter bars stack and full width on mobile */
    .filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }
    .filter-bar select {
        width: 100% !important;
        max-width: none !important;
    }
    .filter-bar .filter-label {
        display: none !important;
    }
}

/* Helper class for locking navigation items */
.nav-item.locked {
    opacity: 0.35 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}


