/* 
 * POB Module Design System
 */
:root {
    --sidebar-width: 260px;
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --surface-dark: #1e293b;
    --text-primary: #1e293b;
    --text-on-dark: #f8fafc;
    --text-muted: #64748b;
    --glass: rgba(255, 255, 255, 0.7);
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

hr {
    background-color: #e2e8f0;
    height: 1px;
    margin: 1.25rem 0;
    opacity: 0.6;
}

body {
    background-color: var(--bg-light);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

#app-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
}

#app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-dark);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

#app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#main-scroll-area {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-light);
}

/* Sidebar Styling */
.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #fff;
}

.sidebar-logo span {
    color: var(--primary-light);
}

.sidebar-menu {
    flex: 1;
    padding: 1rem;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.menu-item i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

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

.menu-item.active {
    background: var(--primary);
    color: #fff;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5rem 1.5rem;
}

.navbar-burger {
    display: none !important;
    margin-left: 0;
}

@media (max-width: 1023px) {
    .navbar-burger {
        display: block !important;
    }
}

/* Cards & Tiles */
.card {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Responsive Card Padding */
@media (max-width: 768px) {
    .card.p-5 {
        padding: 1.25rem !important; /* Slightly more than p-4 (1rem) but less than p-5 (1.5rem) */
    }
}

/* Buttons */
.button.is-primary {
    background-color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.button.is-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Inputs */
.input, .textarea, .select select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

.input:focus, .textarea:focus, .select select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.125em rgba(129, 140, 248, 0.25);
}

/* Utils */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow);
}

/* Data Table Polishing */
.table thead th {
    background: #f1f5f9;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    color: var(--text-muted);
    border-bottom-width: 2px !important;
}

.table th.sort {
    cursor: pointer;
    transition: background 0.2s;
}

.table th.sort:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.table th.sort:after {
    content: ' \2195';
    opacity: 0.3;
}

/* Spacing Utilities */
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

/* Custom Scrollbar for Main Area */
#main-scroll-area::-webkit-scrollbar {
    width: 6px;
}
#main-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}
#main-scroll-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
#main-scroll-area::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

#mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive */
@media (max-width: 1023px) {
    #app-sidebar {
        position: fixed;
        left: -100%;
        height: 100vh;
        transition: left 0.3s ease;
    }
    
    #app-sidebar.active {
        left: 0;
    }

    #main-scroll-area {
        padding: 0.75rem 0.5rem;
    }

    .navbar {
        padding: 0.25rem 0.75rem;
        min-height: 3.25rem;
    }

    .navbar-brand {
        display: flex;
        align-items: center;
        width: 100%;
    }

    .container.is-fluid {
        padding: 0;
    }

    .section {
        padding: 0;
    }

    .page-content {
        padding: 0.5rem 0.25rem;
    }
}

/* POB Specific Components */
.pob-upload-zone {
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.2s ease;
    position: relative;
    min-height: 154px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pob-upload-zone.is-active {
    border-color: var(--primary);
    background: #eff6ff;
}

.pob-preview-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pob-preview-container img {
    max-height: 250px;
    width: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* Animations */
@keyframes fadeOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

/* Dashboard Enhancements */
.dashboard-page {
    padding: 1.25rem;
}

.dashboard-greeting {
    padding-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.greeting-sub {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.35rem !important;
    display: block;
}

.greeting-name {
    font-size: 2.25rem !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    letter-spacing: -0.03em !important;
    color: var(--bg-dark);
    margin: 0 !important;
}

/* Section header — shared by stats and action sections */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.875rem;
}

.section-icon {
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-icon i {
    font-size: 0.625rem;
    color: #fff;
}

.section-title {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 !important;
    line-height: 1;
}

/* Stats section */
.dashboard-section {
    margin-bottom: 1rem;
}

.stat-card-premium {
    background: #ffffff !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.08) !important;
    padding: 1rem !important;
    position: relative;
    overflow: hidden;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.stat-card-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.12) !important;
}

.stat-card-ghost {
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    font-size: 4rem;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

.stat-label {
    text-transform: uppercase;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.07em;
    margin-bottom: 0.375rem;
    position: relative;
    z-index: 1;
}

.stat-value {
    font-size: 1.75rem !important;
    font-weight: 800 !important;
    color: var(--bg-dark);
    line-height: 1;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
}

.stat-footer {
    font-size: 0.7rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    margin: 0;
}

/* Quick Actions section */
.quick-action-btn {
    height: auto !important;
    font-size: 0.9rem !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25) !important;
}

@media (min-width: 769px) {
    .dashboard-page {
        padding: 2rem;
    }

    .dashboard-greeting {
        padding-top: 1rem;
        margin-bottom: 2rem;
    }

    .greeting-name {
        font-size: 3rem !important;
    }

    .stat-card-premium {
        border-radius: 20px !important;
        padding: 1.5rem !important;
    }

    .stat-value {
        font-size: 2.25rem !important;
    }

    .quick-action-btn {
        padding: 0.875rem 1.75rem !important;
        font-size: 1rem !important;
    }
}

/* ─── Approval Card ──────────────────────────────────────────── */
.apv-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    height: 100%;
}

.apv-card:hover {
    box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.13);
    transform: translateY(-2px);
}

/* Meta row: MR tag + date */
.apv-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.125rem 0;
}

.apv-mr-tag {
    display: inline-flex;
    align-items: center;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 99px;
    border: 1px solid #bfdbfe;
    letter-spacing: 0.01em;
}

.apv-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Hero: brand + chemist */
.apv-hero {
    padding: 0.75rem 1.125rem 0.875rem;
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.apv-hero-content {
    flex: 1;
}

.apv-brand {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--bg-dark);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 0.625rem 0;
}

/* Image Preview */
.apv-image-preview {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.apv-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.apv-image-preview:hover .apv-img {
    transform: scale(1.1);
}

.apv-img-zoom {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.5);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.apv-image-preview:hover .apv-img-zoom {
    opacity: 1;
}

.apv-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: 700;
}

.apv-chemist {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.apv-chemist-icon {
    width: 26px;
    height: 26px;
    background: #f1f5f9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.apv-chemist-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--bg-dark);
    line-height: 1.3;
}

.apv-chemist-place {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Metrics row */
.apv-metrics {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    padding: 0.75rem 1.125rem;
}

.apv-metric {
    flex: 1;
    text-align: center;
}

.apv-metric-divider {
    width: 1px;
    height: 2.25rem;
    background: #e2e8f0;
    flex-shrink: 0;
}

.apv-metric-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.apv-metric-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--bg-dark);
    line-height: 1;
}

/* Footer / action area */
.apv-footer {
    padding: 0.875rem 1.125rem 1rem;
    background: #fafbfc;
}

/* Approve / Reject toggle buttons */
.apv-toggle-row {
    display: flex;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.apv-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.5rem;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    color: var(--text-muted);
    user-select: none;
}

.apv-toggle-btn:hover {
    border-color: #cbd5e1;
    color: var(--bg-dark);
}

.apv-toggle-approve.is-selected {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #15803d;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.apv-toggle-reject.is-selected {
    background: #fff5f7;
    border-color: #f14668;
    color: #c0143c;
    box-shadow: 0 0 0 3px rgba(241, 70, 104, 0.12);
}

/* Rejection reason */
.apv-reason-wrap {
    margin-bottom: 0.75rem;
}

.apv-reason-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #c0143c;
    margin-bottom: 0.4rem;
}

.apv-reason-textarea {
    border-color: #fca5a5 !important;
    background: #fff5f7 !important;
    font-size: 0.85rem !important;
    resize: none;
}

.apv-reason-textarea.is-danger {
    box-shadow: 0 0 0 2px rgba(241, 70, 104, 0.25) !important;
}

/* Submit + cancel row */
.apv-actions-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.apv-cancel-btn {
    color: var(--text-muted);
    font-size: 0.78rem !important;
}

.apv-submit-btn {
    font-weight: 700 !important;
    border-radius: 8px !important;
    font-size: 0.82rem !important;
    height: 2.25rem !important;
    padding: 0 1rem !important;
}
