/* Modern Color Palette & Variables */
:root {
    --primary-color: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --secondary-color: #10b981;
    /* Emerald 500 */
    --background-color: #f3f4f6;
    /* Gray 100 */
    --surface-color: #ffffff;
    --text-primary: #111827;
    /* Gray 900 */
    --text-secondary: #6b7280;
    /* Gray 500 */
    --border-color: #e5e7eb;
    /* Gray 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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);
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #818cf8 100%);
    --card-radius: 12px;
}

body {
    background-color: var(--background-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Dashboard Layout */
.dashboard-container {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 3fr 2fr;
        /* 60% Left, 40% Right */
        grid-template-rows: auto auto 1fr auto;
    }

    .dashboard-header {
        grid-column: 1 / -1;
    }
}

/* Header & Controls */
.dashboard-header {
    background: var(--surface-color);
    padding: 1.25rem;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-right: auto;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s;
    outline: none;
    background-color: #f9fafb;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background-color: white;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
}

/* Panels */
.panel {
    background: var(--surface-color);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.highlight-text {
    color: var(--primary-color);
    font-weight: 700;
}

/* Data Table */
.table-container {
    flex: 1;
    overflow: auto;
    position: relative;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.modern-table th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.modern-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modern-table tr:hover td {
    background-color: #f3f4f6;
    cursor: pointer;
}

.modern-table tr.selected td {
    background-color: #eef2ff;
    color: var(--primary-color);
    font-weight: 500;
}

/* Footer Totals */
.panel-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background-color: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.total-badge {
    background: #d1fae5;
    color: #065f46;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.85rem;
}

.footer-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1rem;
    color: var(--text-primary);
}

/* Right Panel specific */
.chart-container {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to bottom, #ffffff, #f9fafb);
}

.chart-placeholder {
    width: 100%;
    height: 200px;
    background: #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

/* Utilities */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.w-full {
    width: 100%;
}

.mt-4 {
    margin-top: 1rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== HOME DASHBOARD STYLES ===== */
.home-dashboard {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
}

.dashboard-hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.hero-title svg {
    color: #4f46e5;
    -webkit-text-fill-color: #4f46e5;
    filter: drop-shadow(0 2px 4px rgba(79, 70, 229, 0.3));
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 1024px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

.dashboard-card {
    background: var(--surface-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #4f46e5;
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(to bottom, #ffffff, #f9fafb);
    border-bottom: 1px solid var(--border-color);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sales-icon {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.sales-icon svg {
    color: white;
    stroke-width: 2.5;
}

.grn-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.grn-icon svg {
    color: white;
    stroke-width: 2.5;
}

.card-title-section {
    flex: 1;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.card-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
    background: #fafbfc;
}

.stat-box {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-box .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-box .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dashboard-card .chart-container {
    padding: 1.5rem;
    flex: 1;
    min-height: 300px;
}

.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: linear-gradient(to top, #f9fafb, #ffffff);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.view-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4f46e5;
    transition: gap 0.2s ease;
}

.dashboard-card:hover .view-details {
    gap: 0.75rem;
}

.view-details svg {
    transition: transform 0.2s ease;
}

.dashboard-card:hover .view-details svg {
    transform: translateX(4px);
}

/* ===== DETAIL PAGES STYLES ===== */
.details-container {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    min-height: 100vh;
}

.details-header {
    margin-bottom: 2rem;
}

.btn-back {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 0.625rem 1rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

.btn-back:hover {
    background: var(--background-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(-4px);
}

.header-title-section {
    text-align: left;
}

.details-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.title-icon {
    color: var(--primary-color);
}

.details-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.grid-panel {
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to right, #f8fafc, #ffffff);
}

.grid-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.grid-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-box {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    min-width: 250px;
    transition: all 0.2s ease;
    background: var(--surface-color);
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.table-wrapper {
    overflow-x: auto;
    max-height: 600px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.details-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc;
}

.details-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.details-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.details-table tbody tr {
    transition: background-color 0.15s ease;
}

.details-table tbody tr:hover {
    background-color: #f9fafb;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #f1f5f9;
    color: #334155;
    background-image: none;
}

.badge.bg-light {
    background: #f8fafc !important;
    background-image: none !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

.grn-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.amount-cell {
    font-weight: 700;
    color: #059669;
}

.grid-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Date Filter Bar */
.date-filter-bar {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-group input[type="date"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--surface-color);
    transition: all 0.2s ease;
}

.filter-group input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-refresh {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.btn-refresh:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.4);
}

.chart-instruction {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Analytics Section */
.analytics-section {
    margin-top: 3rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.analytics-card {
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.3s ease;
}

.analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.analytics-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(to right, #f8fafc, #ffffff);
    border-bottom: 1px solid var(--border-color);
}

.analytics-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.chart-wrapper {
    padding: 1.5rem;
    height: 300px;
}

.no-data-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.no-data-state svg {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.no-data-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.no-data-state p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* ==========================================================================
   IMAGE 1 & IMAGE 2 RECREATION EXACT STYLING
   ========================================================================== */

/* Top Horizontal Nav Tab Bar */
.top-nav-tabs-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    min-width: 0;
}

.top-nav-tabs-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    flex: 1 1 auto;
    min-width: 0;
    padding-bottom: 2px;
}

.top-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.top-tab-btn:hover, .top-tab-btn.active {
    background: #ffffff;
    border-color: #94a3b8;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Admin Profile in Sidebar */
.admin-profile-section {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.avatar-wrapper {
    position: relative;
    width: 84px;
    height: 84px;
    margin-bottom: 0.75rem;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.2rem;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
    border: 2px solid rgba(255,255,255,0.3);
    overflow: hidden;
}

.avatar-img-actual {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-badge-icon {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #0284c7;
    border: 2px solid #081730;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.05em;
    margin: 0;
}

.admin-email {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.15rem;
    margin-bottom: 0.75rem;
}

.btn-change-photo {
    padding: 0.25rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.05);
    color: #ffffff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-change-photo:hover {
    background: rgba(255,255,255,0.15);
    border-color: #ffffff;
}

/* Image 1 Exec KPI Grid */
.kpi-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1100px) {
    .kpi-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .kpi-cards-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-card {
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.kpi-card-sales {
    background: linear-gradient(135deg, #0c2340 0%, #081730 100%);
}

.kpi-card-purchase {
    background: linear-gradient(135deg, #20649c 0%, #1e5280 100%);
}

.kpi-card-production {
    background: linear-gradient(135deg, #6f2dbd 0%, #581c9c 100%);
}

.kpi-card-quality {
    background: linear-gradient(135deg, #c62828 0%, #9a0007 100%);
}

.kpi-title-pill {
    align-self: flex-start;
    background: #ffffff;
    color: #0f172a;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.35rem 2rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    margin-bottom: 1rem;
    text-align: center;
    width: 100%;
}

.kpi-main-val {
    font-size: 1.75rem;
    font-weight: 800;
    margin-top: 0.5rem;
    color: #ffffff;
}

.kpi-sub-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.25rem;
    color: rgba(255,255,255,0.9);
}

/* Yellow Check Now Button */
.btn-yellow-check {
    background: #f59e0b;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.45rem 1.25rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
    transition: transform 0.15s, background 0.15s;
}

.btn-yellow-check:hover {
    background: #d97706;
    transform: translateY(-1px);
}

/* Image 2 Top 10 Report Styling */
.top10-container {
    padding: 1.5rem;
    background: #f8fafc;
    min-height: 100vh;
}

.top10-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.top10-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.top10-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 0.2rem;
}

.filter-card-inline {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-card-inline .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.filter-card-inline label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.filter-card-inline select, .filter-card-inline input {
    height: 36px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 0.85rem;
    padding: 0 0.6rem;
}

.btn-apply-filters {
    background: #ffffff;
    border: 1.5px solid #2563eb;
    color: #2563eb;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.45rem 1.25rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-apply-filters:hover,
.btn-apply-filters.active {
    background: #2563eb;
    color: #ffffff;
}

.btn-reset-filters {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.45rem 1.25rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset-filters:hover {
    background: #f1f5f9;
}

/* Image 2 Side-by-Side Panels */
.top10-panels-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .top10-panels-grid {
        grid-template-columns: 1fr;
    }
}

.top10-panel {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.top10-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tag-yellow {
    background: #fef08a;
    color: #854d0e;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-right: 0.4rem;
}

.tag-cyan {
    background: #cffafe;
    color: #155e75;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-right: 0.4rem;
}

.total-badge-blue {
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
}

.total-badge-dark {
    background: #475569;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
}

/* Image 2 Black Header Table */
.dark-header-table-container {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-top: 1rem;
}

.dark-header-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.dark-header-table th {
    background: #111827;
    color: #ffffff;
    font-weight: 700;
    padding: 0.6rem 0.75rem;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dark-header-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.dark-header-table tr:nth-child(even) {
    background-color: #f8fafc;
}

.dark-header-table .amount-sales {
    color: #047857;
    font-weight: 700;
}

.dark-header-table .amount-purchase {
    color: #1d4ed8;
    font-weight: 700;
}

/* ═══════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0c2340 0%, #1e3a5f 50%, #0c2340 100%);
    padding: 24px;
    font-family: 'Inter', system-ui, sans-serif;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 44px 40px 40px;
    width: 100%;
    max-width: 430px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: loginFadeIn 0.4s ease;
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Avatar circle */
.login-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #0c2340;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 4px 16px rgba(12,35,64,0.35);
}

.login-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #0c2340;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: #64748b;
    font-size: 0.88rem;
    margin: 0 0 28px;
    text-align: center;
}

/* Error banner */
.login-error {
    width: 100%;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    animation: loginShake 0.35s ease;
}

@keyframes loginShake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

/* Fields */
.login-field {
    width: 100%;
    margin-bottom: 20px;
}

.login-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0c2340;
    margin-bottom: 7px;
    letter-spacing: 0.02em;
}

/* Select dropdown */
.login-select-wrapper {
    position: relative;
}

.login-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding: 12px 40px 12px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.login-select:focus {
    border-color: #0c2340;
    box-shadow: 0 0 0 3px rgba(12,35,64,0.12);
}

.login-select-arrow {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.7rem;
    pointer-events: none;
}

/* Password input */
.login-input-wrapper {
    position: relative;
}

.login-input {
    width: 100%;
    padding: 12px 44px 12px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.login-input::placeholder { color: #94a3b8; }

.login-input:focus {
    border-color: #0c2340;
    box-shadow: 0 0 0 3px rgba(12,35,64,0.12);
}

.login-input-error,
.login-select.login-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.15) !important;
}

/* Eye toggle */
.login-eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.login-eye-btn:hover { color: #0c2340; }

/* Login button */
.login-btn {
    width: 100%;
    padding: 14px;
    background: #0c2340;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    cursor: pointer;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(12,35,64,0.35);
}
.login-btn:hover:not(:disabled) {
    background: #1e3a5f;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(12,35,64,0.4);
}
.login-btn:active:not(:disabled) { transform: translateY(0); }
.login-btn:disabled { opacity: 0.75; cursor: not-allowed; }

/* Spinner inside button */
.login-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loginSpin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes loginSpin {
    to { transform: rotate(360deg); }
}

/* Change Password additions */
.login-change-pwd-btn {
    width: 100%;
    padding: 12px;
    background: #f8fafc;
    color: #1e3a5f;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.login-change-pwd-btn:hover {
    background: #e2e8f0;
    border-color: #0c2340;
    color: #0c2340;
}

.login-back-btn {
    width: 100%;
    padding: 11px;
    background: transparent;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.login-back-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #94a3b8;
}

.login-success {
    width: 100%;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 11px 14px;
    color: #166534;
    font-size: 0.86rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    animation: loginFadeIn 0.35s ease;
}

.login-user-badge {
    width: 100%;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    font-size: 0.88rem;
    color: #334155;
}
.login-user-badge strong {
    color: #0c2340;
    font-weight: 700;
}
.login-user-badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #dcfce7;
    color: #15803d;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.login-step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
    width: 100%;
}
.login-step-pill {
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.login-step-pill.active {
    background: #0c2340;
    color: #fff;
    box-shadow: 0 2px 8px rgba(12,35,64,0.25);
}
.login-step-pill.completed {
    background: #16a34a;
    color: #fff;
}
.login-step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
