/* FPS Gujarat Portal - Custom Styles */
/* Theme: Deep Teal & White (Government) */

:root {
    --sidebar-width: 260px;
    --navbar-height: 56px;
    --primary-color: #0f766e;
    --primary-dark: #0d5f59;
    --primary-light: #14b8a6;
    --primary-soft: #ecfdf5;
    --sidebar-bg: #134e4a;
    --sidebar-hover: #1a6b64;
    --sidebar-active: #14b8a6;
    --accent: #d4a017;
}

/* Body */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0fdf4;
    padding-top: var(--navbar-height);
}

/* Navbar */
.navbar-dark.bg-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color)) !important;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - var(--navbar-height));
    background-color: var(--sidebar-bg);
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-nav .nav-link {
    color: #a7d8d2;
    padding: 12px 20px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    font-size: 14px;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.sidebar-nav .nav-link.active {
    background-color: var(--sidebar-active);
    color: #fff;
    border-left-color: #fff;
}

.sidebar-nav .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 10px;
}

/* Content Wrapper */
.content-wrapper {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: calc(100vh - var(--navbar-height));
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* Sidebar collapsed */
.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar.collapsed + .content-wrapper {
    margin-left: 0;
    width: 100%;
}

/* Stats Cards */
.stat-card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .stat-label {
    font-size: 13px;
    color: #64748b;
}

/* Report Header */
.report-header {
    border-radius: 12px;
    overflow: hidden;
}

.report-header-inner {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.report-header-top {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px 14px;
}

.report-header-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.report-header-title h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.report-header-month {
    margin-top: 4px;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}

.report-header-month strong {
    color: #fff;
}

.report-header-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: rgba(0,0,0,0.1);
    padding: 0;
}

.report-detail-item {
    display: flex;
    flex-direction: column;
    padding: 10px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-right: 1px solid rgba(255,255,255,0.08);
}

.report-detail-item:nth-child(2n) {
    border-right: none;
}

.report-detail-item:nth-last-child(-n+2) {
    border-bottom: none;
}

.report-detail-label {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.report-detail-label i {
    width: 14px;
    text-align: center;
    margin-right: 4px;
}

.report-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

@media (max-width: 575px) {
    .report-header-details {
        grid-template-columns: 1fr;
    }
    .report-detail-item {
        border-right: none;
    }
    .report-detail-item:nth-last-child(-n+2) {
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .report-detail-item:last-child {
        border-bottom: none;
    }
    .report-header-top {
        padding: 16px;
    }
}

/* Print Report Header */
@media print {
    .report-header-inner {
        background: #fff !important;
        color: #000 !important;
        border: 2px solid #333;
    }
    .report-header-title h4 { color: #000 !important; }
    .report-header-month { color: #333 !important; }
    .report-header-month strong { color: #000 !important; }
    .report-detail-label { color: #666 !important; }
    .report-detail-value { color: #000 !important; }
    .report-header-icon { background: #eee !important; color: #333 !important; }
    .report-header-details { background: #f5f5f5 !important; }
    .report-detail-item { border-color: #ccc !important; }
}

/* Tables */
.table-custom {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.table-custom thead th {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    border: none;
}

.table-custom tbody td {
    vertical-align: middle;
    font-size: 14px;
}

.table-custom tbody tr:hover {
    background-color: var(--primary-soft);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

/* Override Bootstrap card header colors */
.card-header.bg-primary { background-color: var(--primary-color) !important; }
.card-header.bg-info { background-color: #0e7490 !important; }
.card-header.bg-success { background-color: #15803d !important; }
.card-header.bg-warning { background-color: #b45309 !important; color: #fff !important; }

/* Buttons */
.btn {
    border-radius: 8px;
    font-size: 14px;
}

.btn-sm {
    border-radius: 6px;
    font-size: 12px;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

.btn-outline-light:hover {
    color: var(--primary-color) !important;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border-color: #cbd5e1;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15,118,110,0.15);
}

/* Export Buttons Row */
.export-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Quick Links */
.quick-link-card {
    border: 1px solid #d1e7e4;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.2s;
    text-decoration: none;
    color: #1e293b;
    display: block;
}

.quick-link-card:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-soft);
    color: var(--primary-color);
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.login-card .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
    border: none !important;
}

.login-card .text-primary {
    color: var(--primary-color) !important;
}

/* Shop Selector */
.shop-select-card {
    border: 2px solid #d1e7e4;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-select-card:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-soft);
    transform: translateY(-2px);
}

.shop-select-card.selected {
    border-color: var(--primary-color);
    background-color: #ccfbf1;
}

/* Badge overrides */
.badge.bg-primary { background-color: var(--primary-color) !important; }
.badge.bg-info { background-color: #0e7490 !important; }

/* Pagination */
.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.page-link {
    color: var(--primary-color);
}

.page-link:hover {
    color: var(--primary-dark);
    background-color: var(--primary-soft);
}

/* Print Styles */
@media print {
    .navbar, .sidebar, .export-buttons, .btn, .no-print {
        display: none !important;
    }
    .content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
    body {
        padding-top: 0;
        background: #fff;
    }
    .report-header {
        border: 1px solid #000;
    }
    .table-custom thead th {
        background-color: #0f766e !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .content-wrapper {
        margin-left: 0;
        width: 100%;
    }
}

/* Warning badge */
.badge-warning-custom {
    background-color: #fef3c7;
    color: #92400e;
    font-weight: 500;
}

/* WhatsApp Button */
.btn-whatsapp {
    background-color: #25D366;
    color: #fff;
    border: none;
}

.btn-whatsapp:hover {
    background-color: #1da851;
    color: #fff;
}

/* Dropdown active */
.dropdown-item.active, .dropdown-item:active {
    background-color: var(--primary-color);
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--sidebar-active);
    border-radius: 4px;
}

/* Nav tabs */
.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-tabs .nav-link:hover {
    color: var(--primary-dark);
}

/* Alert links */
.alert a {
    color: var(--primary-color);
    font-weight: 600;
}
