/* portal/assets/css/portal.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Oyo State Brand Palette */
    --vercel-sidebar-bg: #0f172a;
    /* Slate 900 */
    --vercel-sidebar-hover: #1e293b;
    /* Slate 800 */
    --vercel-sidebar-active: hsl(145, 55%, 27%);
    /* Brand Primary Green */
    --vercel-sidebar-text: #94a3b8;
    /* Slate 400 */
    --vercel-sidebar-text-active: #ffffff;
    /* White */
    --vercel-body-bg: #f1f5f9;
    /* Brand BG */
    --vercel-card-bg: #ffffff;
    --vercel-text-primary: #0f172a;
    --vercel-text-secondary: #64748b;
    /* Slate 500 */

    --vercel-purple-gradient-start: hsl(145, 55%, 27%);
    /* Brand Green */
    --vercel-purple-gradient-end: hsl(217, 67%, 36%);
    /* Brand Blue */

    --vercel-border: #e2e8f0;
    /* Slate 200 */

    --brand-primary: hsl(145, 55%, 27%);
    --brand-primary-light: hsl(145, 55%, 45%);
    --brand-secondary: hsl(217, 67%, 36%);
}

/* Base Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--vercel-body-bg);
    color: var(--vercel-text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Layout Framework */
.portal-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar Styling */
.portal-sidebar {
    background-color: var(--vercel-sidebar-bg);
    color: var(--vercel-sidebar-text);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    margin-bottom: 2rem;
    padding-left: 1rem;
}

.sidebar-brand-title {
    color: var(--vercel-sidebar-active);
    /* Green branding */
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-brand-subtitle {
    color: var(--vercel-sidebar-text);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--vercel-sidebar-text);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.sidebar-link i {
    /* Assuming FontAwesome */
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-link:hover {
    background-color: var(--vercel-sidebar-hover);
    color: var(--vercel-sidebar-text-active);
}

.sidebar-link.active {
    background-color: var(--vercel-sidebar-active);
    color: var(--vercel-sidebar-text-active);
}

.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid var(--vercel-sidebar-hover);
    padding-top: 1rem;
}

/* Main Content Area */
.portal-content {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.page-header {
    margin-bottom: 1rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--vercel-text-primary);
}

.page-subtitle {
    color: var(--vercel-text-secondary);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* Utility Cards */
.card {
    background: var(--vercel-card-bg);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    padding: 1.5rem;
    border: 1px solid var(--vercel-border);
}

.card-gradient {
    background: linear-gradient(135deg, var(--vercel-purple-gradient-start), var(--vercel-purple-gradient-end));
    color: white;
    border: none;
}

.card-gradient .card-title {
    color: rgba(255, 255, 255, 0.9);
}

.card-gradient .card-value {
    color: white;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--vercel-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--vercel-text-primary);
}

/* Dashboard Grid Component */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Data Tables */
.data-table-container {
    background: var(--vercel-card-bg);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    border: 1px solid var(--vercel-border);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background-color: #f8fafc;
    color: var(--vercel-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--vercel-border);
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--vercel-border);
    color: var(--vercel-text-primary);
    font-size: 0.95rem;
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Pills / Badges */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.pill-green {
    background-color: #dcfce7;
    color: #166534;
}

.pill-purple {
    background-color: #f3e8ff;
    color: #6b21a8;
}

.pill-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

.pill-yellow {
    background-color: #fef9c3;
    color: #854d0e;
}

.pill-red {
    background-color: #fee2e2;
    color: #991b1b;
}

.action-link {
    color: var(--brand-primary, hsl(145, 55%, 27%));
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.action-link:hover {
    color: var(--brand-primary-light, hsl(145, 55%, 45%));
    text-decoration: underline;
}

/* Avatar */
.avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, hsla(145, 55%, 27%, 0.15), hsla(217, 67%, 36%, 0.15));
    color: hsl(145, 55%, 27%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 0.75rem;
}

.flex-center {
    display: flex;
    align-items: center;
}

/* =============================================
   MOBILE TOP BAR (hidden on desktop)
   ============================================= */
.mobile-top-bar {
    display: none;
}

/* =============================================
   MOBILE ELEMENTS (Hidden on Desktop)
   ============================================= */
.mobile-top-bar,
.mobile-trigger-btn,
.mobile-nav-backdrop {
    display: none;
}

/* =============================================
   RESPONSIVE: TABLETS (≤1024px)
   ============================================= */
@media (max-width: 1024px) {
    .portal-layout {
        grid-template-columns: 1fr;
    }

    .portal-content {
        padding: 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .card-value {
        font-size: 1.75rem;
    }
}

/* =============================================
   RESPONSIVE: MOBILE (≤768px)
   ============================================= */
@media (max-width: 768px) {

    body,
    html {
        overflow-x: hidden;
    }

    /* --- Backdrops & Triggers --- */
    .mobile-nav-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 9990;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .mobile-nav-backdrop.is-active {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-trigger-btn {
        position: fixed;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(15, 23, 42, 0.85);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
        color: white;
        padding: 0.85rem 1.75rem;
        border-radius: 99px;
        font-family: inherit;
        font-weight: 600;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        gap: 0.6rem;
        z-index: 9991;
        cursor: pointer;
        transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s, opacity 0.3s;
    }

    .mobile-trigger-btn:active {
        transform: translateX(-50%) scale(0.95);
        background: rgba(15, 23, 42, 0.95);
    }

    .mobile-trigger-btn.is-hidden {
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, 20px);
    }

    /* --- Mobile Top Bar --- */
    .mobile-top-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1.25rem;
        background: var(--vercel-sidebar-bg);
        color: white;
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-top-bar .brand-text {
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--vercel-sidebar-active);
    }

    .mobile-top-bar .brand-sub {
        font-size: 0.65rem;
        color: var(--vercel-sidebar-text);
        display: block;
        margin-top: 0.1rem;
    }

    .mobile-top-bar .mobile-signout {
        color: var(--vercel-sidebar-text);
        font-size: 1.1rem;
        text-decoration: none;
        padding: 0.5rem;
        border-radius: 50%;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        display: none;
        /* Hide top sign out to put it in drawer */
    }

    /* --- Futuristic Glassmorphic Bottom Drawer --- */
    .portal-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        height: auto;
        max-height: 85vh;
        width: 100%;
        z-index: 9995;
        flex-direction: column;
        padding: 2.5rem 1.5rem 3rem 1.5rem;
        background: rgba(15, 23, 42, 0.85);
        /* Slate 900 trans */
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-radius: 28px 28px 0 0;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: none;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
        transform: translateY(110%);
        transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .portal-sidebar.is-open {
        transform: translateY(0);
    }

    /* Grab Handle */
    .portal-sidebar::before {
        content: "";
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 48px;
        height: 5px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 10px;
    }

    .sidebar-brand {
        display: none;
    }

    .sidebar-menu {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        padding: 0;
    }

    .sidebar-link {
        flex-direction: row;
        gap: 1rem;
        padding: 1rem 1.25rem;
        font-size: 1.05rem;
        font-weight: 600;
        border-radius: 16px;
        background: transparent;
        color: rgba(255, 255, 255, 0.7);
        border: 1px solid transparent;
        transition: all 0.2s ease;
        justify-content: flex-start;
        align-items: center;
    }

    .sidebar-link i {
        font-size: 1.25rem;
        width: 24px;
        margin: 0;
        color: var(--brand-primary);
        text-align: center;
    }

    .sidebar-link.active {
        background: linear-gradient(135deg, hsla(145, 55%, 27%, 0.15), hsla(217, 67%, 36%, 0.15));
        border-color: hsla(145, 55%, 27%, 0.3);
        color: #fff;
    }

    .sidebar-link:active {
        transform: scale(0.98);
        background: rgba(255, 255, 255, 0.1);
    }

    .sidebar-bottom {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 1rem;
        margin-top: 1rem;
    }

    .sidebar-bottom .sidebar-link {
        color: #ef4444;
        /* Destructive action styling */
    }

    .sidebar-bottom .sidebar-link i {
        color: #ef4444;
    }

    /* --- Content Adjustments --- */
    .portal-layout {
        grid-template-columns: 1fr;
        padding-bottom: 100px;
        /* Space for floating trigger button */
    }

    .portal-content {
        padding: 1.25rem;
        gap: 1.25rem;
    }

    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .page-title {
        font-size: 1.35rem;
    }

    .page-subtitle {
        font-size: 0.85rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: 0.625rem;
    }

    .card-value {
        font-size: 1.5rem;
    }

    .card-title {
        font-size: 0.8rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-grid>[style*="grid-column: span 2"] {
        grid-column: span 1 !important;
    }

    .data-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .action-link {
        font-size: 0.8rem;
    }

    .avatar-small {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
        margin-right: 0.5rem;
    }

    .pill {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    div[style*="grid-template-columns: 320px"] {
        grid-template-columns: 1fr !important;
    }

    div[style*="grid-template-columns: 300px"] {
        grid-template-columns: 1fr !important;
    }

    div[style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
    }

    div[style*="display: flex"][style*="gap: 2rem"] {
        flex-direction: column !important;
    }

    div[style*="display: flex"][style*="gap: 1rem"][style*="margin-bottom"] {
        flex-direction: column !important;
    }
}

@media (max-width: 480px) {
    .portal-content {
        padding: 1rem;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .card {
        padding: 1rem;
    }

    .card-value {
        font-size: 1.25rem;
    }

    div[style*="display: flex"][style*="gap: 1rem"] {
        flex-direction: column !important;
    }

    div[style*="grid-template-columns: repeat(auto-fill"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 520px) {
    .auth-bg {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-card {
        padding: 2rem 1.5rem !important;
        border-radius: 0.75rem !important;
        max-width: 100% !important;
    }
}