/* TaxHub BD - Updated Style matching Next.js version */

:root {
    --color-primary: #006a4e;
    /* Bangladesh Green */
    --color-primary-hover: #00563f;
    --color-secondary: #f42a41;
    /* Bangladesh Red */
    --color-secondary-hover: #d21f33;
    --color-accent: #f6bb42;

    --color-background: #f8fafc;
    --color-surface: #ffffff;
    --color-text-main: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 0.5rem;

    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-background);
    color: var(--color-text-main);
    min-height: 100vh;
}

/* Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    background-color: var(--color-primary);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.sidebar h2 {
    padding: 1rem 1rem 0.25rem 1rem;
    font-size: 1.4rem;
    text-align: center;
    font-weight: 800;
    color: white;
    margin-bottom: 0;
}

.sidebar h2 span {
    color: var(--color-accent);
}

.sidebar nav {
    padding: 0.25rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    color: #ffffff;
    /* Contrast fix: Pure white */
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.85rem;
}

.sidebar nav a span {
    font-size: 1.1rem;
    /* Bigger Icon */
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

.sidebar nav a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-active {
    background-color: white !important;
    color: #006a4e !important;
    /* Force Dark Green text on active */
    font-weight: 700 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-active span {
    filter: none;
}

/* Content Area */
.main-content {
    flex: 1;
    margin-left: 230px;
    padding: 2rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

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

.card,
.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--color-primary);
    margin-bottom: 20px;
}

.stat-card h3,
.card h3 {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-main);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 106, 78, 0.1);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

table th {
    background-color: #f0fdf4;
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.9rem;
}

table tr:hover {
    background-color: #f8fafc;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Login Page Specific */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--color-background);
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--color-primary);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: var(--color-primary);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

/* Mobile Navigation Toggle */
.mobile-toggle {
    display: none;
    /* Hidden on desktop */
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 9999;
    /* Super high z-index */
    background: var(--color-primary);
    color: white;
    border: 2px solid white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.mobile-toggle:hover {
    background: var(--color-primary-hover);
    transform: scale(1.05);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    /* Below sidebar, above content */
    backdrop-filter: blur(3px);
    transition: opacity 0.3s;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }

    /* Force Sidebar to be fixed off-screen initially */
    .sidebar {
        width: 240px !important;
        position: fixed !important;
        top: 0;
        left: -260px !important;
        /* Move off-screen using left */
        height: 100vh;
        z-index: 1000 !important;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding-top: 2rem !important;
        /* Adjust padding */
    }

    /* When active class is added by JS */
    .sidebar.active {
        left: 0 !important;
        /* Slide in */
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.5);
    }

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

    /* Better Toggle Button */
    .mobile-toggle {
        display: block !important;
        color: white !important;
        background: var(--color-primary) !important;
        width: 45px;
        height: 45px;
        padding: 0;
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        border-radius: 8px;
        top: 15px;
        left: 15px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100%;
        padding: 1rem;
        padding-top: 5rem;
    }

    /* NBR Stats Grid (Desktop Default) */
    .nbr-stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1rem;
        font-size: 0.9rem;
    }

    .nbr-stats-item {
        text-align: center;
        border-right: 1px solid #e2e8f0;
    }

    .nbr-stats-item:last-child {
        border-right: none;
    }

    /* Fix Title Spacing */
    .section-title {
        font-size: 1.5rem;
        margin-top: 1rem;
        line-height: 1.4;
    }

    /* Fix NBR Notice Card Grid on Mobile */
    /* Fix NBR Notice Card Grid on Mobile */
    .nbr-stats-grid {
        grid-template-columns: 1fr !important;
        /* Stack vertically */
        gap: 0 !important;
    }

    .nbr-stats-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-right: none !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        text-align: left !important;
    }

    .nbr-stats-item:last-child {
        border-bottom: none;
    }

    .nbr-stats-item div:first-child {
        font-size: 0.9rem !important;
        font-weight: 500;
        color: #64748b;
        margin-bottom: 0 !important;
    }

    .nbr-stats-item div:last-child {
        font-size: 1rem !important;
    }

    /* Smaller Section Titles */
    .section-title,
    h2 {
        font-size: 1.25rem !important;
        margin-top: 0.5rem;
    }

    h3 {
        font-size: 1.1rem !important;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .card-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Adjust table for mobile */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}