:root {
    /* Premium Executive Design System */
    --primary-color: #1d4ed8;
    /* Trust Blue */
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    --secondary-color: #4f46e5;
    --emerald-color: #10b981;
    /* Growth Green */
    --accent-amber: #f59e0b;
    --accent-rose: #e11d48;
    /* Soft Red */

    /* Dynamic Background - Premium & Alive */
    --bg-gradient: radial-gradient(circle at top left, #fafafa 0%, #f4f5f7 50%, #eaecf0 100%);
    --sidebar-dark-bg: #0f172a;
    /* Dark Blue Mix */
    --card-bg: #ffffff;

    --text-main: #1e293b;
    --text-muted: #475569;
    --text-light: #f8fafc;

    --border-color: rgba(29, 78, 216, 0.1);
    --border-radius: 20px;
    --sidebar-width: 260px;
    --transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    --shadow-lux: 0 25px 50px -12px rgba(15, 23, 42, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-dark-bg);
    border-left: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    right: 0;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.sidebar-header {
    padding: 2.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-light);
    letter-spacing: -1px;
}

.logo i {
    font-size: 1.8rem;
    filter: drop-shadow(0 4px 6px rgba(99, 102, 241, 0.2));
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    padding: 1rem 1.2rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.95rem;
}

.sidebar-nav li i {
    font-size: 1.4rem;
    width: 30px;
    text-align: center;
    opacity: 0.8;
    transition: var(--transition);
}

.sidebar-nav li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    transform: translateX(-5px);
}

.sidebar-nav li:hover i {
    transform: scale(1.2) rotate(10deg);
}

/* Specific Sidebar Colors per Menu */
.sidebar-nav li[data-page="dashboard"]:hover i {
    color: #1d4ed8;
}

.sidebar-nav li[data-page="statistics"]:hover i,
.sidebar-nav li[data-page="reports"]:hover i {
    color: #4338ca;
}

.sidebar-nav li[data-page="cases"]:hover i,
.sidebar-nav li[data-page="hidden"]:hover i,
.sidebar-nav li[data-page="exceptional"]:hover i {
    color: #e879f9;
}

.sidebar-nav li[data-page="donations"]:hover i {
    color: #22c55e;
    text-shadow: 0 0 10px rgba(234, 179, 8, 0.6);
}

.sidebar-nav li[data-page="expenses"]:hover i {
    color: #e11d48;
}

.sidebar-nav li[data-page="volunteers"]:hover i {
    color: #fb923c;
}

.sidebar-nav li[data-page="affidavit"]:hover i {
    color: #06b6d4;
}

.sidebar-nav li[data-page="settings"]:hover i {
    color: #8b5cf6;
}

.sidebar-nav li.active {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.top-header {
    height: 60px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-main);
    position: sticky;
    top: 0;
    z-index: 900;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

.ribbon {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 2rem;
    display: flex;
    gap: 30px;
    align-items: center;
}

.ribbon-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 15px;
    border-left: 1px solid var(--border-color);
}

.ribbon-group:last-child {
    border-left: none;
}

.ribbon-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.icon-btn {
    background: #f1f5f9;
    border: none;
    font-size: 1.1rem;
    color: var(--text-main);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
}

.icon-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    background: rgba(241, 245, 249, 0.8);
    backdrop-filter: blur(4px);
    padding: 0 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.search-box:focus-within {
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    border-color: var(--primary-color);
    width: 320px !important;
}

/* Zoom Controls Header Styling */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 30px;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.zoom-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.zoom-btn:hover {
    background: #e2e8f0;
    color: var(--primary-color);
    transform: scale(1.1);
}

.zoom-btn.reset-zoom {
    margin-right: 5px;
    padding-right: 8px;
    border-right: 1px solid var(--border-color);
    border-radius: 0;
    font-size: 0.9rem;
}

#zoom-level {
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
    user-select: none;
    color: var(--text-main);
}


.search-box input {
    background: none;
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
}

.notifications {
    position: relative;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.notifications .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 10px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
}

.user-profile:hover {
    background: #f1f5f9;
}

.user-profile img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.user-profile span {
    font-weight: 700;
    font-size: 0.9rem;
}

/* Content Area */
.content-area {
    padding: 1.5rem;
    max-width: 100%;
    margin: 0;
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.8rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lux);
    border-color: var(--primary-color);
}

/* Varied Dashboard Card Backgrounds - Dark & Light Mix */
.stat-card:nth-child(1) {
    border-right: 5px solid var(--primary-color);
    background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
}

.stat-card:nth-child(1) .stat-icon {
    background: var(--primary-color);
    color: white;
}

.stat-card:nth-child(2) {
    border-right: 5px solid var(--emerald-color);
    background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
}

.stat-card:nth-child(2) .stat-icon {
    background: var(--emerald-color);
    color: white;
}

.stat-card:nth-child(3) {
    border-right: 5px solid var(--accent-amber);
    background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
}

.stat-card:nth-child(3) .stat-icon {
    background: #b45309;
    color: white;
}

.stat-card:nth-child(4) {
    border-right: 5px solid var(--accent-rose);
    background: linear-gradient(135deg, #ffffff 0%, #fdf2f8 100%);
}

.stat-card:nth-child(4) .stat-icon {
    background: #9d174d;
    color: white;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.icon-emerald {
    background: #ecfdf5;
    color: #10b981;
}

.icon-blue {
    background: #eff6ff;
    color: #3b82f6;
}

.icon-amber {
    background: #fffbeb;
    color: #f59e0b;
}

.icon-purple {
    background: #f5f3ff;
    color: #8b5cf6;
}

/* Tables & Lists */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.2rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow: 0 4px 14px 0 rgba(29, 78, 216, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.4);
    filter: brightness(1.1);
}

.table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
    /* Force table to be wide enough for all data */
}

.data-table th {
    text-align: right;
    padding: 16px 15px;
    background: linear-gradient(180deg, #e81123 0%, #d13438 100%);
    /* Official Premium Red */
    color: #ffffff;
    font-weight: 800;
    border-bottom: 3px solid #a80000;
    font-size: 0.95rem;
    white-space: nowrap;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 10;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 0.9rem;
    color: var(--text-main);
}

.data-table tr {
    transition: var(--transition);
}

.data-table tr:hover {
    background-color: rgba(99, 102, 241, 0.05) !important;
}

/* Chromatic Columns for the Table */
.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    color: #d13438;
    font-weight: 800;
}

/* Research # */
.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    color: #059669;
}

/* Center */
.data-table th:nth-child(5),
.data-table td:nth-child(5) {
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.03);
}

/* Name */
.data-table th:nth-child(10),
.data-table td:nth-child(10) {
    color: #b45309;
}

/* Status */
.data-table th:nth-child(11),
.data-table td:nth-child(11) {
    color: #7c3aed;
}

/* Category */
.data-table th:nth-child(12),
.data-table td:nth-child(12) {
    color: #2563eb;
}

/* Source */

.main-case-row {
    cursor: pointer;
    transition: background 0.2s;
}

.main-case-row:hover {
    background-color: #f0f7ff !important;
}

.family-members-row {
    background-color: #fafafa;
    border-right: 4px solid var(--primary-color);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.family-members-row>td {
    padding: 0 !important;
}

.nested-card {
    background: white;
    margin: 15px;
    border-radius: 8px;
    border: 1px solid #eef0f2;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Image Preview Styles */
.image-preview-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.img-container {
    position: relative;
    width: 140px;
    height: 140px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.img-container:hover img {
    transform: scale(1.1);
}

.img-overlay-btns {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: space-around;
    padding: 5px 0;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.img-container:hover .img-overlay-btns {
    opacity: 1;
}

.mini-btn-change,
.mini-btn-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.mini-btn-change:hover {
    background: var(--accent-color);
}

.mini-btn-remove:hover {
    background: #d13438;
}

.no-img {
    width: 140px;
    height: 140px;
    background: #fdfdfd;
    border: 2px dashed #bbb;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
}

.no-img:hover {
    border-color: var(--accent-color);
    background: #f0f7ff;
    color: var(--accent-color);
}

/* Status Bar - Dark Contrast */
.status-bar {
    height: 32px;
    background: var(--sidebar-dark-bg);
    color: rgba(255, 255, 255, 0.7);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 0.8rem;
    z-index: 1000;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-pending {
    background: #fffbeb;
    color: #d97706;
}

.status-completed {
    background: #ecfdf5;
    color: #059669;
}

/* Login Styling */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f3f2f1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 400px;
    border-top: 4px solid var(--primary-color);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.login-body p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.input-group {
    position: relative;
    margin-bottom: 15px;
}

.input-group i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
}

.input-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.1);
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
}

.modal-card {
    background: white;
    width: 95%;
    max-width: 1200px;
    height: 95vh;
    border-radius: 24px;
    box-shadow: var(--shadow-lux);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(40px) scale(0.98);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.modal-header h3 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.close-modal {
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 40px;
    flex: 1;
    overflow-y: auto;
    background: #fcfcfd;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.input-group-office {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group-office label {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.95rem;
}

.office-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #eef2f6;
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
    background: #fcfcfd;
}

.office-input:focus {
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Colorful Modal Input Groups (Festival of Colors) */
.input-group-office:nth-child(1) label {
    color: #d13438;
}

.input-group-office:nth-child(1) .office-input {
    border-right: 4px solid #d13438;
}

.input-group-office:nth-child(2) label {
    color: #059669;
}

.input-group-office:nth-child(2) .office-input {
    border-right: 4px solid #059669;
}

.input-group-office:nth-child(3) label {
    color: #2563eb;
}

.input-group-office:nth-child(3) .office-input {
    border-right: 4px solid #2563eb;
}

.input-group-office:nth-child(4) label {
    color: #7c3aed;
}

.input-group-office:nth-child(4) .office-input {
    border-right: 4px solid #7c3aed;
}

.input-group-office:nth-child(5) label {
    color: #db2777;
}

.input-group-office:nth-child(5) .office-input {
    border-right: 4px solid #db2777;
}

.input-group-office:nth-child(6) label {
    color: #ea580c;
}

.input-group-office:nth-child(6) .office-input {
    border-right: 4px solid #ea580c;
}

.input-group-office:nth-child(7) label {
    color: #0891b2;
}

.input-group-office:nth-child(7) .office-input {
    border-right: 4px solid #0891b2;
}

/* Classification Grid */
.classification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    background: #f8fafc;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.check-item:hover {
    background: #edf2f7;
}

.check-item input {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

#case-modal .modal-card {
    max-width: 1300px;
    height: 98vh;
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    padding: 25px 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.modal-footer {
    padding: 20px 35px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border-color);
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Office Form Elements */
.office-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.1s;
}

.office-input:focus {
    border-color: var(--accent-color);
}

.office-input::placeholder {
    color: #a19f9d;
}

/* ============================================================
   MOBILE WALLET STYLE (Responsive Design)
============================================================ */
@media (max-width: 1024px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }

    /* Override inline grids that break mobile layout */
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: 2fr 1fr"],
    div[style*="grid-template-columns: repeat(3, 1fr)"],
    div[style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
    }

    body {
        background: #f4f5f7; /* Flat, clean background for mobile */
    }

    .app-container {
        flex-direction: column;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Transform Sidebar to Bottom Nav Bar */
    .sidebar {
        position: fixed;
        bottom: 0;
        top: auto !important;
        right: 0 !important;
        left: 0;
        width: 100%;
        height: 70px;
        background: white;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -5px 20px rgba(0,0,0,0.08);
        z-index: 2000;
        border-radius: 20px 20px 0 0;
        overflow-y: hidden;
        overflow-x: auto;
    }

    .sidebar-header { 
        display: none; /* Hide logo on bottom nav */
    }

    .sidebar-nav {
        padding: 0;
        display: flex;
        height: 100%;
    }

    .sidebar-nav ul {
        display: flex;
        flex-direction: row;
        width: max-content;
        min-width: 100%;
        justify-content: space-around;
        align-items: center;
        padding: 0 5px;
        margin: 0;
    }

    .sidebar-nav li {
        flex-direction: column;
        justify-content: center;
        padding: 5px 8px;
        margin: 0;
        gap: 4px;
        border-radius: 12px;
        color: #94a3b8; /* Flat unselected color */
    }

    .sidebar-nav li i {
        font-size: 1.3rem;
    }

    .sidebar-nav li span {
        font-size: 0.65rem;
        display: block; /* Show text compactly */
        font-weight: 600;
    }

    .sidebar-nav li.active {
        background: transparent;
        color: var(--primary-color);
        box-shadow: none;
    }

    .sidebar-nav li.active i {
        color: var(--primary-color) !important;
        transform: translateY(-2px);
    }

    /* Main Content Spacing */
    .main-content {
        margin-right: 0 !important;
        margin-bottom: 70px;
        width: 100%;
    }

    .top-header {
        padding: 0 15px;
        height: 60px;
        justify-content: space-between;
    }

    .header-left span {
        font-size: 0.95rem; /* Smaller title */
        font-weight: 800;
    }

    .header-left > span {
        display: none; /* Hide the static title text on very small screens if it overflows, or just let it shrink */
    }

    #toggle-sidebar {
        display: none !important; /* Not needed for bottom nav */
    }

    .zoom-controls {
        display: flex !important; /* Un-hide zoom on mobile */
        gap: 5px !important;
        transform: scale(0.85); /* Make it fit */
        transform-origin: left center;
    }

    .search-box {
        width: 110px !important;
        padding: 6px 15px 6px 30px !important;
        font-size: 0.85rem !important;
    }
    
    .search-box:focus-within {
        width: 180px !important;
        position: absolute;
        left: 50px;
        z-index: 10;
    }

    /* Cards & Stats - Wallet vibe */
    .content-area {
        padding: 15px 10px;
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        width: 100%;
    }

    .stat-card {
        padding: 1.4rem;
        border-radius: 24px; /* More rounded wallet feel */
        gap: 15px;
        align-items: center;
        width: 100%;
    }

    .card {
        padding: 1.2rem;
        border-radius: 20px;
        margin-bottom: 20px;
        width: 100%;
        max-width: calc(100vw - 20px);
        overflow-x: hidden;
    }

    .ribbon {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 10px 5px;
        gap: 10px;
        background: transparent;
        border-bottom: none;
        padding-bottom: 20px; /* Space for scrollbar */
    }

    .ribbon-group {
        border-left: none;
        border-right: 1px solid rgba(0,0,0,0.05);
        padding: 0 10px;
    }
    .ribbon-group:first-child {
        border-right: none;
    }

    .btn-primary {
        min-width: 140px;
        font-size: 0.9rem !important;
        padding: 10px 15px !important;
        justify-content: center;
        white-space: nowrap;
    }

    /* Tables scroll sideways smoothly */
    .table-container {
        border: none;
        box-shadow: none;
        border-radius: 0;
        margin: 0 -10px; /* Bleed out */
        padding: 0 10px;
        width: 100vw;
        max-width: 100vw;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 700px; /* Force scroll but smaller */
        width: 100%;
        max-width: none;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .modal-card {
        width: 100%;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0;
        margin: 0;
        transform: none !important;
    }
    
    .modal-header {
        padding: 15px 20px;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .status-bar {
        bottom: 70px; /* Above bottom nav */
        border-radius: 12px 12px 0 0;
        margin: 0 10px;
        width: calc(100% - 20px);
    }
}

/* Searchable Dropdown Styles */
.dropdown-container {
    position: relative;
    width: 100%;
}

.dropdown-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 2000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: none;
}

.dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f8f8f8;
    transition: background 0.2s;
    text-align: right;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: #f0f7f2;
}

.dropdown-item strong {
    display: block;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.dropdown-item span {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

/* Mode Toggles */
#single-aid-toggle,
#bulk-aid-toggle {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
}

#single-aid-toggle:not(.btn-primary),
#bulk-aid-toggle:not(.btn-primary) {
    opacity: 0.7;
}

#single-aid-toggle.btn-primary,
#bulk-aid-toggle.btn-primary {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 1;
}