/* 🎨 Modern SaaS Dashboard Styling */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.2);
    --secondary: #64748b;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --sidebar-bg: #1e293b;
    --sidebar-active: #334155;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 🏰 Sidebar Modernization */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

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

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.875rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.sidebar-menu li a i {
    font-size: 1.1rem;
    width: 20px;
}

.sidebar-menu li a:hover {
    color: white;
    background: rgba(255,255,255,0.03);
}

.sidebar-menu li a.active {
    color: white;
    background: var(--sidebar-active);
    border-left-color: var(--primary);
    box-shadow: inset 4px 0 10px rgba(59, 130, 246, 0.1);
}

.menu-header {
    padding: 1.5rem 1.5rem 0.5rem;
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* 🚀 Main Content Area */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    width: calc(100% - 260px);
    min-width: 0; /* Crucial for allowing internal scroll on wide tables */
}

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

.dashboard-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.dashboard-header h2 span {
    color: var(--primary);
}

.logout-btn {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-1px);
}

/* 📈 Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.75rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0.6;
}

.stat-card h3 {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

/* 📊 Dashboard Summary Grid Fixes */
.dashboard-summary-grid {
    grid-template-columns: repeat(3, 1fr) !important;
}

.value-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.sub-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
}

.sub-value span {
    font-weight: 800;
    color: var(--text-main);
}

/* 📑 Cards & Containers */
.search-container, .section-content, .dashboard-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-color);
}

.section-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

/* 🛠 Inputs & Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-main);
    background-color: white;
    transition: var(--transition);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.search-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

/* 🔘 Modern Buttons */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-back:hover {
    background-color: #e2e8f0;
    color: #1e293b;
    transform: translateX(-3px);
}

.btn-back i {
    font-size: 0.8rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
    filter: brightness(1.1);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
    filter: brightness(1.1);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.4);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.4);
    filter: brightness(1.1);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.4);
    filter: brightness(1.1);
}

.refresh-btn {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 10px;
    transition: var(--transition);
}

.export-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.export-btn.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}

.refresh-btn:hover, .export-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid var(--border-color);
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* 📊 Modern Tables */
.data-table-container {
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    width: 100%;
    max-height: 70vh;
    scroll-behavior: smooth;
    margin-top: 1.5rem;
    animation: fadeInTable 0.5s ease-out;
}

.dashboard-card .data-table-container {
    flex: 1;
    margin-top: 0; /* No margin inside cards */
}

@keyframes fadeInTable {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white !important;
    padding: 1.125rem 1.5rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

tbody td {
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    color: #1e293b;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    max-width: 300px;
    word-break: break-word;
}

/* Table Alignments & Widths */
.text-left { text-align: left !important; }
.text-right { text-align: right !important; font-variant-numeric: tabular-nums; }
.text-center { text-align: center !important; }

.col-retailer, .col-name { 
    min-width: 180px !important; 
    text-align: left !important;
}

.col-dsename {
    min-width: 130px !important;
    text-align: left !important;
}

.col-date {
    width: 140px !important;
    white-space: nowrap !important;
}

.col-mode {
    width: 130px !important;
    text-align: left !important;
}

.col-final-total {
    min-width: 140px !important;
    white-space: nowrap !important;
}

.col-narrow { 
    width: 90px !important; 
    padding-left: 0.5rem !important; 
    padding-right: 0.5rem !important;
    text-align: right !important;
}

.col-id {
    width: 80px !important; 
    text-align: left !important;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

tbody tr:hover {
    background-color: #f1f5f9;
}

/* Table Special Rows */
/* Opening Balance Highlight (Soft Blue) */
tr[style*="background: #fff3cd"], tr[style*="background:#fff3cd"], tr.opening-row {
    background-color: #eff6ff !important; 
    color: #1e40af !important;
    font-weight: 600;
}

/* Totals Row Highlight - Royal Indigo Theme */
tfoot tr {
    background-color: #f5f3ff !important;
    font-weight: 800;
    color: #4338ca !important;
    border-top: 2px solid #c7d2fe;
}

tfoot td {
    padding: 1.125rem 1.5rem;
}

/* Nested Grid Highlights */
.nested-container {
    padding: 1.5rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 1rem;
}

/* Dashboard Specific Layout */
.dashboard-flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: stretch;
    margin-top: 2rem;
    width: 100%;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 400px;
    flex: 1 1 calc(50% - 20px);
}

.report-card { 
    max-width: calc(45% - 10px);
    flex: 1 1 calc(45% - 10px);
}
.dse-card { 
    max-width: calc(55% - 10px);
    flex: 1 1 calc(55% - 10px);
}

/* Visibility Utilities (CRITICAL) */
.d-none { display: none !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }

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

.card-header h3 {
    margin-bottom: 0 !important;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Zebra Striping */
tbody tr:nth-child(even) {
    background-color: rgba(248, 250, 252, 0.8);
}

tbody tr:nth-child(odd) {
    background-color: white;
}

/* Header Alignment logic for overall sections */
.section-header-actions {
    display: flex;
    justify-content: flex-end; /* Original was right aligned */
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

/* Responsive Dashboard */
@media (max-width: 1200px) {
    .dashboard-flex-row {
        flex-direction: column;
    }
    .report-card, .dse-card {
        width: 100%;
    }
}

.report-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: #f8fafc;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    transition: var(--transition);
    min-height: 250px;
}

.report-placeholder i {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    opacity: 0.25;
    transition: var(--transition);
}

.report-placeholder:hover {
    background-color: #f1f5f9;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.report-placeholder:hover i {
    opacity: 0.6;
    transform: scale(1.1);
}

/* 📱 Responsiveness */
@media (max-width: 1024px) {
    .sidebar { width: 80px; }
    .sidebar-header h3, .sidebar-menu li a span { display: none; }
    .main-content { margin-left: 80px; width: calc(100% - 80px); }
    .sidebar-menu li a { justify-content: center; padding: 1rem; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; width: 100%; padding: 1.5rem; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* 🔑 Modern Login Page */
.login-body {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    margin: 0;
    overflow: hidden;
}

.login-card {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 420px;
    animation: loginFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
    display: inline-block;
}

.login-header h2 {
    font-size: 1.875rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0.5rem 0;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #475569;
    font-size: 0.875rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 1.25rem;
    color: #94a3b8;
    transition: var(--transition);
}

.input-with-icon input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3.25rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-with-icon input:focus + i {
    color: var(--primary);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.4);
    filter: brightness(1.1);
}

.btn-login:active {
    transform: translateY(0);
}

.error-msg {
    color: var(--danger);
    background-color: #fef2f2;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    margin-top: 1.5rem;
    border: 1px solid #fee2e2;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 2rem;
}

.dashboard-card {
    height: 120px;
    padding: 16px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--border-color);
    min-height: auto;
    flex: none;
    margin-bottom: 0;
}

.dashboard-card h3 {
    margin-bottom: 8px !important;
    font-size: 0.85rem !important;
    color: var(--text-muted);
}

.dashboard-card .value, .dashboard-card .sub-value span {
    font-size: 1.5rem !important;
    font-weight: 700;
}

.dashboard-card .sub-value {
    font-size: 0.9rem !important;
}

.performance-section {
    margin-top: 1rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-left: 4px solid var(--primary);
    padding-left: 12px;
}

.performance-grid {
    display: flex !important;
    gap: 30px;
    width: 100% !important;
    justify-content: space-between;
}

.performance-grid .stat-card {
    flex: 1 1 calc(50% - 15px) !important;
    max-width: calc(50% - 15px) !important;
}

/* Dashboard Footer Grid (Latest Report & DSE) */
.dashboard-footer-grid {
    display: flex !important;
    gap: 30px;
    margin-top: 3rem;
    align-items: stretch;
    width: 100% !important;
    justify-content: space-between;
}

.footer-card {
    flex: 1 1 calc(50% - 15px) !important;
    max-width: calc(50% - 15px) !important;
    min-height: 520px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    min-width: 0 !important;
}

.footer-card table {
    width: 100% !important;
}

.footer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.footer-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.footer-card .card-header h3 {
    margin: 0 !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-card .data-table-container {
    flex: 1;
    overflow-y: auto;
    border-radius: 12px;
    background: #fbfcfd;
    border: 1px solid #edf2f7;
}

/* Premium Footer Table Styles */
.footer-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.footer-table thead th {
    background: var(--secondary);
    color: white;
    padding: 16px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.footer-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.95rem;
    color: var(--text-main);
}

.footer-table tbody tr:hover {
    background-color: #f1f5f9;
}

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

.dashboard-footer-grid .card-header h3 {
    margin: 0 !important;
    font-size: 1rem !important;
    color: var(--text-main);
}

.report-placeholder-sm {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    min-height: 480px;
    color: var(--text-muted);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: #fbfcfd;
}

.report-placeholder-sm i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-actions button {
    padding: 6px 12px;
    font-size: 0.85rem;
}

@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
    .dashboard-footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .performance-grid { grid-template-columns: 1fr !important; }
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background-color: #f8fafc;
    width: auto !important;
}

.filter-date {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    width: auto !important;
}

.btn-refresh-sm {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-refresh-sm:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* 🎭 Modern Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content-sm {
    max-width: 400px;
    padding: 2.5rem;
    text-align: center;
}

.login-style-header {
    flex-direction: column;
    align-items: center;
    border-bottom: none;
    padding-bottom: 0;
}

.login-style-header h2 {
    margin-top: 1rem;
    font-size: 1.5rem;
    color: var(--slate-900);
}

.login-style-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.lock-icon-circle {
    width: 60px;
    height: 60px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.password-field {
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    height: 60px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.password-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.error-text {
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 500;
}

.border-none {
    border: none !important;
}

.modal-content-sm .modal-footer {
    padding-top: 0;
    justify-content: center;
    gap: 15px;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2.5rem;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

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

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

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

.close-modal:hover {
    color: var(--danger);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}
/* ?? Entry Dashboard Special Styling */
.entry-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.action-card {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.action-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.action-card .icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: var(--transition);
}

.action-card:hover .icon-circle {
    transform: scale(1.1);
}

.bg-primary-soft { background-color: #eff6ff; color: #3b82f6; }
.bg-success-soft { background-color: #ecfdf5; color: #10b981; }
.bg-warning-soft { background-color: #fffbeb; color: #f59e0b; }
.bg-danger-soft { background-color: #fef2f2; color: #ef4444; }

.action-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.action-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.entry-form-container {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-header-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
}

.form-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.totals-display {
    display: flex;
    gap: 2rem;
    font-weight: 700;
}

.totals-display input {
    width: 100px;
    display: inline-block;
    border: none;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 800;
    color: #3b82f6;
}

#stockItemsTable thead th, #inventoryItemsTable thead th {
    background: #f1f5f9;
    color: #475569 !important;
    font-size: 0.75rem;
    padding: 12px;
}
