/* Top Bar Professional Spacing */
.top-bar {
    height: 80px;
    padding: 0 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
/* Hide the actual radio button */
.att-input {
    display: none;
}

/* Base Pill Style */
.att-pill {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-block;
    transition: all 0.2s ease;
    color: #64748b;
}

/* Specific Colors on Hover/Select */
.pill-present:hover { background: #dcfce7; color: #166534; }
.pill-absent:hover { background: #fee2e2; color: #991b1b; }
.pill-late:hover { background: #fef3c7; color: #92400e; }

/* The "Magic" - When Radio is Checked */
.att-input:checked + .pill-present { background: #22c55e; color: white; box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3); }
.att-input:checked + .pill-absent { background: #ef4444; color: white; box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3); }
.att-input:checked + .pill-late { background: #f59e0b; color: white; box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3); }

/* The Submit Button Glow */
.owlio-btn {
    background: var(--primary-blue);
    color: white;
    padding: 12px 30px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 74, 173, 0.2);
    transition: 0.3s;
}

.owlio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(0, 74, 173, 0.3);
}
:root {
    --primary-blue: #004aad;
    --accent-gold: #ffde59;
    --bg-light: #f4f7f6;
    --text-main: #1e293b;
}

body { font-family: 'Inter', sans-serif; background: var(--bg-light); margin: 0; }
.wrapper { display: flex; min-height: 100vh; }

/* Sidebar with Glowing Effects */
.sidebar {
    width: 260px; background: #00122e; color: white;
    position: fixed; height: 100vh; display: flex; flex-direction: column;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-link {
    padding: 15px 25px; color: rgba(255,255,255,0.6); text-decoration: none;
    display: flex; align-items: center; gap: 15px; transition: 0.3s;
}

.sidebar-link:hover, .sidebar-link.active {
    color: var(--accent-gold); background: rgba(255,255,255,0.05);
    border-left: 4px solid var(--accent-gold);
}

.main-content { flex: 1; margin-left: 260px; padding: 40px; }

/* Owlio Cards */
.owlio-card {
    background: white; border-radius: 20px; padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.02);
}
:root {
    --primary-blue: #002d62; /* Pebbles Navy */
    --accent-gold: #d4af37;  /* Pebbles Gold */
    --bg-light: #f4f7fa;
    --text-main: #1e293b;
    --sidebar-width: 260px;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    margin: 0;
    display: flex;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-blue);
    height: 100vh;
    position: fixed;
    color: white;
    padding-top: 20px;
}

.sidebar-brand {
    padding: 20px 30px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--accent-gold);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 15px 30px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: 0.3s;
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 4px solid var(--accent-gold);
}

.sidebar-link i { margin-right: 15px; width: 20px; }

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 40px;
}

/* Login / unauthenticated pages — no sidebar offset */
.main-content.no-sidebar {
    margin-left: 0;
    width: 100%;
    padding: 0;
}

/* Premium Card Design */
.owlio-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
    margin-bottom: 30px;
    padding: 30px;
}

/* Input & Button Polish */
.owlio-input, .owlio-select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    background: #fdfdfd;
    transition: 0.3s;
    box-sizing: border-box; /* Fixes the "extending" issue */
}

.owlio-input:focus {
    border-color: var(--primary-blue);
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 45, 98, 0.1);
}

.owlio-btn {
    background: var(--primary-blue);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.owlio-btn:hover {
    background: #001a3a;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

/* Scrollable sidebar menu for deep navigation stacks */
.sidebar {
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 50px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* ============================================
   HAMBURGER BUTTON (mobile only)
   ============================================ */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1100;
    background: #002d62;
    color: white;
    border: none;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.hamburger-btn:hover {
    background: #003580;
}

/* ============================================
   MOBILE OVERLAY BACKDROP
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

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

/* ============================================
   LAYOUT UTILITY CLASSES
   ============================================ */

/* Page header */
.page-header {
    margin-bottom: 24px;
}
.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin: 0 0 6px;
}
.page-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

/* Stats 4-column grid */
.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Stat card internals */
.stat-card {
    padding: 20px;
    margin-bottom: 0;
}
.stat-label {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    margin-top: 5px;
}

/* Auto-fit grid for signal cards */
.owlio-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

/* Profit card */
.profit-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}
.profit-amount {
    min-width: 160px;
}
.profit-bar {
    flex-grow: 1;
    min-width: 200px;
}

/* Table horizontal scroll wrapper */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* --- Tablet (≤ 1024px) --- */
@media (max-width: 1024px) {
    .main-content {
        padding: 30px;
    }
    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Mobile (≤ 768px) --- */
@media (max-width: 768px) {
    /* Show hamburger */
    .hamburger-btn {
        display: flex;
    }

    /* Sidebar becomes slide-in overlay */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        width: 280px;
    }
    .sidebar.open {
        transform: translateX(0);
    }

    /* Main content — full width, clear sidebar */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 72px 16px 24px;
        box-sizing: border-box;
    }
    .main-content.no-sidebar {
        padding: 0;
    }

    /* Top bar */
    .top-bar {
        padding: 0 14px 0 64px !important;
        height: 62px !important;
    }

    /* Page header */
    .page-header {
        padding: 4px 0 12px;
        margin-bottom: 16px;
    }
    .page-title {
        font-size: 1.3rem;
    }
    .page-subtitle {
        font-size: 0.82rem;
    }

    /* Cards */
    .owlio-card {
        padding: 16px !important;
        border-radius: 12px !important;
        margin-bottom: 14px !important;
    }

    /* Stats grid: 4 → 2 columns */
    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .stat-card {
        padding: 14px !important;
    }
    .stat-number {
        font-size: 1.4rem;
    }

    /* Profit card stacks vertically */
    .profit-inner {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    .profit-bar {
        width: 100%;
        min-width: unset;
    }
    .profit-amount {
        min-width: unset;
    }

    /* Login page */
    .login-grid {
        grid-template-columns: 1fr !important;
        padding: 20px 16px !important;
        min-height: auto !important;
        gap: 16px !important;
    }

    /* Tables — horizontal scroll */
    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        min-width: 480px;
    }

    /* Form elements */
    .owlio-form-group {
        margin-bottom: 12px;
    }

    /* Global fixes for inline grids and max-widths on mobile */
    [style*="grid-template-columns"]:not(.keep-grid-mobile) {
        grid-template-columns: 1fr !important;
    }
    .owlio-grid {
        grid-template-columns: 1fr !important;
    }
    [style*="max-width"] {
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Search bar shrink */
    #globalSearch {
        width: 110px !important;
    }

    /* Hide username text in topbar, keep avatar */
    .top-bar .user-controls [style*="text-align: right"] {
        display: none !important;
    }

    /* Nav header labels */
    .nav-header {
        padding: 12px 20px 4px !important;
        font-size: 0.6rem !important;
    }

    /* Report/action buttons */
    .report-actions .owlio-btn {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
}

/* --- Small phones (≤ 480px) --- */
@media (max-width: 480px) {
    .main-content {
        padding: 68px 12px 20px;
    }

    /* Stats: 2 → 1 column */
    .stats-grid-4 {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .owlio-card {
        padding: 12px !important;
        margin-bottom: 10px !important;
    }

    .top-bar {
        padding: 0 10px 0 60px !important;
    }

    #globalSearch {
        width: 80px !important;
    }

    .login-grid {
        padding: 14px 12px !important;
    }

    .stat-number {
        font-size: 1.2rem;
    }
}

/* ============================================
   PWA SAFE AREA (notched phones — iPhone X+)
   ============================================ */
@supports (padding: max(0px)) {
    .main-content {
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .hamburger-btn {
        top: max(14px, env(safe-area-inset-top));
        left: max(14px, env(safe-area-inset-left));
    }
}


/* end of styles */
