/* Global Design System for MAGA Micro-Finance System */

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

:root {
    /* Color Palette */
    --bg-base: #080c14;
    --bg-app: #0c111e;
    --bg-card: rgba(17, 25, 40, 0.75);
    --bg-card-hover: rgba(26, 36, 56, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(6, 182, 212, 0.25);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --primary: #06b6d4;
    --primary-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --secondary: #3b82f6;
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --success-border: rgba(16, 185, 129, 0.25);
    
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-border: rgba(245, 158, 11, 0.25);
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(239, 68, 68, 0.25);
    
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.12);
    --info-border: rgba(59, 130, 246, 0.25);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius-sm: 8px;
    --border-radius-md: 14px;
    --border-radius-lg: 20px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    letter-spacing: -0.01em;
    font-size: 0.9rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.95rem; }

/* App Container Layout */
.app-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-app);
}

/* Sidebar Styling Overrides */
.sidebar {
    display: none !important;
}

/* Top Navbar Styling */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    background-color: #090e18;
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(12px);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.navbar-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.navbar-brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-links {
    display: flex;
    gap: 1.25rem;
}

.navbar-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.navbar-links a:hover,
.navbar-links a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.navbar-links a.active {
    background: rgba(6, 182, 212, 0.1);
    color: var(--primary);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile-nav {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

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

.user-dropdown {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    background: #0f1626;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1rem;
    min-width: 150px;
    box-shadow: var(--shadow-md);
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1001;
}

.user-profile-nav:hover .user-dropdown {
    display: flex;
}

.user-dropdown-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.4rem;
}

.sign-out-btn {
    color: var(--danger);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    transition: opacity var(--transition-fast);
}

.sign-out-btn:hover {
    opacity: 0.8;
}

.btn-cron {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.08);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-cron:hover {
    background: rgba(245, 158, 11, 0.15);
}

.btn-cron svg {
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.hamburger-btn {
    display: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

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

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

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

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

/* Main Content Layout */
.main-wrapper {
    margin-left: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: calc(var(--header-height) + 1.5rem) 2rem 2rem 2rem;
    max-width: 100vw;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.page-title h1 {
    font-size: 2rem;
    margin-bottom: 0.2rem;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Dashboard Cards (Stats Grid) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
}

.stat-card.primary::before { background: var(--primary-gradient); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-md);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.stat-card.primary .stat-icon { color: var(--primary); background: rgba(6, 182, 212, 0.08); }
.stat-card.success .stat-icon { color: var(--success); background: rgba(16, 185, 129, 0.08); }
.stat-card.warning .stat-icon { color: var(--warning); background: rgba(245, 158, 11, 0.08); }
.stat-card.danger .stat-icon { color: var(--danger); background: rgba(239, 68, 68, 0.08); }

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 0.4rem;
}

.stat-footer {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.charts-grid-equal {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 992px) {
    .charts-grid, .charts-grid-equal {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm);
}

.chart-title {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-family: 'Outfit', sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-container {
    position: relative;
    width: 100%;
    min-height: 250px;
    min-width: 0;
    overflow: hidden;
}

.chart-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Standard Section Layouts */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm);
}

/* Data Tables */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    background: rgba(10, 15, 26, 0.4);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.data-table th {
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
    transition: background-color var(--transition-fast);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover td {
    background-color: var(--bg-card-hover);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

.badge-active { background-color: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-completed { background-color: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.badge-overdue { background-color: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); animation: pulse 2s infinite; }
.badge-due-soon { background-color: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-upcoming { background-color: rgba(255, 255, 255, 0.04); color: var(--text-secondary); border: 1px solid var(--border-color); }
.badge-closed { background-color: rgba(255, 255, 255, 0.02); color: var(--text-muted); border: 1px solid var(--border-color); }

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

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

.form-control:disabled {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.form-row-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
}

/* Button UI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    border-radius: var(--border-radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
    color: #fff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Custom Search & Filters */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-input-container {
    position: relative;
    flex: 1;
    max-width: 400px;
    min-width: 250px;
}

.search-input-container svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.search-input-container input {
    padding-left: 2.8rem;
}

.filter-pills {
    display: flex;
    gap: 0.5rem;
}

.filter-pill {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.filter-pill:hover,
.filter-pill.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-pill.active {
    border-color: var(--primary);
    background: rgba(6, 182, 212, 0.1);
    color: var(--primary);
}

/* Notification Logs */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

.alert-item.unread {
    border-left: 3px solid var(--warning);
    background: rgba(245, 158, 11, 0.02);
}

.alert-info-content {
    flex: 1;
}

.alert-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-item-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 8, 16, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #0f1626;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 550px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform var(--transition-fast);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.modal-title {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: #fff;
}

/* Slide Panel for Inline Creation */
.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 100%;
    max-width: 450px;
    background: #0f1626;
    border-left: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    box-sizing: border-box;
}

.side-panel.open {
    transform: translateX(0);
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.side-panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.side-panel-body {
    flex: 1;
    overflow-y: auto;
}

/* Autocomplete results dropdown */
.autocomplete-dropdown {
    position: absolute;
    width: 100%;
    background: #0f1626;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: var(--shadow-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 99;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background-color var(--transition-fast);
}

.autocomplete-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.autocomplete-item-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.autocomplete-item-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.selected-customer-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid var(--border-glow);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1rem;
}

.selected-customer-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary);
}

.selected-customer-remove {
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: bold;
    border: none;
    background: none;
}

.selected-customer-remove:hover {
    color: var(--danger);
}

/* Timelines (Customer Details) */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -1.5rem;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid var(--bg-app);
}

.timeline-item.active .timeline-dot {
    background: var(--primary);
}

.timeline-item.completed .timeline-dot {
    background: var(--success);
}

.timeline-item.overdue .timeline-dot {
    background: var(--danger);
}

.timeline-content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--border-radius-md);
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* System Alerts / Standard notifications banners */
.sys-alert {
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sys-alert-success {
    background: var(--success-bg);
    border-color: var(--success-border);
}

.sys-alert-error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Spinner for submit buttons */
.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Header & Drawer Styles */
.mobile-header {
    display: none;
    background-color: #090e18;
    border-bottom: 1px solid var(--border-color);
    height: 60px;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 101;
}

.hamburger-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.mobile-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation Drawer */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background-color: #090e18;
    border-right: 1px solid var(--border-color);
    z-index: 160;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    transition: left var(--transition-normal);
    overflow-y: auto;
}

.drawer.open {
    left: 0;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.drawer-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* Navigation Drawer List Items */
.drawer .menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.drawer .menu-item {
    width: 100%;
}

.drawer .menu-item a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.drawer .menu-item a svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    flex-shrink: 0;
}

.drawer .menu-item a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.drawer .menu-item.active a {
    background: rgba(6, 182, 212, 0.1);
    color: var(--primary);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.drawer-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }
    .navbar-links, .btn-cron, .user-profile-nav {
        display: none !important;
    }
    .hamburger-btn {
        display: flex !important;
    }
    .top-navbar {
        padding: 0 1rem;
    }
    
    .sidebar {
        display: none !important;
    }
    
    .mobile-header {
        display: none !important;
    }
    
    .app-container {
        padding-top: 0;
        flex-direction: column;
    }
    
    .main-wrapper {
        margin-left: 0;
        padding: calc(var(--header-height) + 1rem) 1rem 85px 1rem;
        max-width: 100vw;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .page-actions {
        width: 100%;
        margin-top: 0.5rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .btn {
        flex: 1;
        width: 100%;
        padding: 0.75rem 1.2rem;
    }

    .mobile-bottom-nav {
        display: flex !important;
    }
}

@media (max-width: 480px) {
    .panel-card, .chart-card, .stat-card {
        padding: 1rem !important;
    }
    .main-wrapper {
        padding: calc(var(--header-height) + 1rem) 0.5rem 85px 0.5rem !important;
    }
}

@media (max-width: 600px) {
    /* Table to Card Stacked Layout */
    .data-table, 
    .data-table thead, 
    .data-table tbody, 
    .data-table th, 
    .data-table td, 
    .data-table tr {
        display: block;
    }
    
    .data-table thead {
        display: none;
    }
    
    .data-table tr {
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius-md);
        margin-bottom: 1.25rem;
        padding: 1rem;
        box-shadow: var(--shadow-sm);
    }
    
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
        padding: 0.75rem 0;
        text-align: right;
        font-size: 0.9rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .data-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-top: 0.75rem;
        justify-content: flex-end;
    }
    
    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        text-align: left;
        margin-right: 1.5rem;
        font-size: 0.85rem;
    }

    .form-row-cols {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .content-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
}

/* Token Pills & SMS Preview Mockups */
.token-helper-bar {
    display: flex;
    align-items: center;
    margin-top: 0.6rem;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.token-pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.token-pill {
    background: rgba(6, 182, 212, 0.08);
    color: var(--primary);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.token-pill:hover {
    background: rgba(6, 182, 212, 0.16);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

.char-counter {
    font-weight: 500;
    margin-top: 0.3rem;
}

.live-preview-box {
    margin-top: 1rem;
    background: rgba(10, 15, 26, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1rem;
}

.preview-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    font-weight: 700;
}

.preview-bubble {
    background: #1e293b;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-primary);
    position: relative;
    max-width: 90%;
    word-break: break-word;
    border-bottom-left-radius: 2px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Tablet Layout Optimization for Content Grids */
@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* Mobile Bottom Nav Styles */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background-color: #090e18;
    border-top: 1px solid var(--border-color);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(12px);
    padding: 0 0.5rem;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 500;
    gap: 0.25rem;
    flex: 1;
    height: 100%;
    transition: all var(--transition-fast);
}

.mobile-nav-item svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-logo-container {
    position: relative;
    width: 55px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-nav-logo-btn {
    position: absolute;
    bottom: 12px; /* Raised effect */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: 4px solid #080c14; /* Match background base */
    box-shadow: 0 -4px 12px rgba(6, 182, 212, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform var(--transition-fast);
}

.mobile-nav-logo-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-nav-logo-btn span {
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: bold;
    font-size: 1.25rem;
}

.mobile-nav-logo-btn:hover {
    transform: translateY(-2px);
}
