/* Hylife Accounting - Custom Design System & Corporate Colors */
:root {
    /* Font Families */
    --font-thai: 'Prompt', sans-serif;
    --font-num: 'Inter', sans-serif;

    /* Light Theme Palette (Hylife Forest Green Theme) */
    --bg-primary: #f2f5f3;
    --bg-sidebar: #0b2e22;          /* Solid Deep Green from corporate logo */
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-input: #ffffff;
    
    --text-primary: #0b1c16;
    --text-secondary: #3b4d45;
    --text-muted: #7d8f85;
    
    --border-color: rgba(184, 196, 189, 0.5);
    --border-focus: #11402f;
    
    /* Brand Colors (Matching Logo Background #11402f) */
    --color-primary: #11402f;
    --color-primary-hover: #0a291e;
    --color-primary-light: rgba(17, 64, 47, 0.1);
    
    --color-success: #16a34a;       /* Green */
    --color-success-hover: #15803d;
    --color-success-light: rgba(22, 163, 74, 0.1);
    
    --color-warning: #ea580c;       /* Orange */
    --color-warning-hover: #ca8a04;
    --color-warning-light: rgba(234, 88, 12, 0.1);
    
    --color-danger: #e11d48;        /* Rose */
    --color-danger-hover: #be123c;
    --color-danger-light: rgba(225, 29, 72, 0.1);

    --color-info: #0284c7;          /* Sky Blue */
    --color-info-light: rgba(2, 132, 199, 0.08);

    /* Shadows & Border Radius */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(17, 64, 47, 0.05), 0 4px 6px -4px rgba(17, 64, 47, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(11, 46, 34, 0.06);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --glass-blur: blur(12px);
}

/* Dark Theme Palette override */
.dark-mode {
    --bg-primary: #050d0a;
    --bg-sidebar: #03140e;
    --bg-card: rgba(11, 28, 22, 0.7);
    --bg-input: #12211b;
    
    --text-primary: #e8f0eb;
    --text-secondary: #9cb0a5;
    --text-muted: #5e7368;
    
    --border-color: rgba(30, 54, 44, 0.5);
    --border-focus: #2da379;
    
    --color-primary: #258562;
    --color-primary-hover: #1e6b4e;
    --color-primary-light: rgba(37, 133, 98, 0.15);
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* Global Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: var(--font-thai);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Utility classes */
.hide { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-bold { font-weight: 600; }
.text-primary { color: var(--color-primary) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary-light { background-color: var(--color-primary-light); }
.bg-success-light { background-color: var(--color-success-light); }
.bg-warning-light { background-color: var(--color-warning-light); }
.bg-danger-light { background-color: var(--color-danger-light); }

.border-left-primary { border-left: 4px solid var(--color-primary); }
.border-left-success { border-left: 4px solid var(--color-success); }
.border-left-warning { border-left: 4px solid var(--color-warning); }

.border-l { border-left: 1px solid var(--border-color); }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.pb-4 { padding-bottom: 16px; }
.mr-2 { margin-right: 8px; }
.justify-end { justify-content: flex-end; }
.btn-block { width: 100%; display: flex; align-items: center; justify-content: center; }

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Glassmorphism Cards */
.glass {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-glass);
    border-radius: var(--radius-md);
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Numbers styling */
input[type="number"], .summary-table td, .table-brackets td, h2, .step-num, .user-role {
    font-family: var(--font-num), var(--font-thai);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-thai);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
}
.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 64, 47, 0.3);
}

.btn-success {
    background-color: var(--color-success);
    color: #ffffff;
}
.btn-success:hover {
    background-color: var(--color-success-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-icon:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

.btn-link {
    background: transparent;
    color: var(--color-primary);
    border: none;
    padding: 0;
}
.btn-link:hover {
    text-decoration: underline;
    color: var(--color-primary-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Badges */
.badge-user {
    background: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid rgba(22, 163, 74, 0.2);
}
.badge-admin {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border: 1px solid rgba(225, 29, 72, 0.2);
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label i {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.input-lg, .select-lg {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 1.05rem;
    width: 100%;
    outline: none;
    transition: all 0.2s ease;
}

.input-md {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    width: 100%;
    outline: none;
}

.input-lg:focus, .select-lg:focus, .input-md:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(17, 64, 47, 0.15);
}

.input-helper {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.select-sm {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

/* Alert Boxes */
.error-alert, .info-alert, .alert-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.error-alert {
    background-color: var(--color-danger-light);
    color: var(--color-danger);
    border: 1px solid rgba(225, 29, 72, 0.2);
}

.info-alert {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border: 1px solid rgba(17, 64, 47, 0.2);
}

.alert-warning {
    background-color: var(--color-warning-light);
    color: var(--color-warning);
    border: 1px solid rgba(234, 88, 12, 0.2);
}

/* Grids */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

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

/* Login Screen Layout */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: radial-gradient(circle at top right, var(--color-primary-light), transparent), 
                radial-gradient(circle at bottom left, var(--color-success-light), transparent),
                linear-gradient(135deg, #091a13 0%, #030806 100%);
}

.login-card {
    width: 100%;
    max-width: 460px;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    background: rgba(11, 28, 22, 0.75);
    border: 1px solid rgba(184, 196, 189, 0.15);
    color: #e8f0eb;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.logo-container {
    display: inline-flex;
    margin-bottom: 16px;
    justify-content: center;
    align-items: center;
}

.login-logo {
    max-width: 110px;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.login-header h2 {
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #ffffff;
}

.login-header p {
    color: #9cb0a5;
    font-size: 0.9rem;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#login-form label {
    color: #9cb0a5;
}

#login-form input {
    background-color: #12211b;
    border-color: rgba(184, 196, 189, 0.15);
    color: #ffffff;
}

#login-form input:focus {
    border-color: var(--color-success);
}

.login-footer {
    margin-top: 30px;
}

.info-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(184, 196, 189, 0.2);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: #9cb0a5;
}

.info-box strong {
    display: block;
    margin-bottom: 6px;
    color: #ffffff;
}

.credentials-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.credentials-grid code {
    background: rgba(255, 255, 255, 0.1);
    color: #34d399;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

/* App Main Container Layout */
.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
    color: #e8f0eb;
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(184, 196, 189, 0.15);
}

.brand-logo {
    max-width: 45px;
    height: auto;
    border-radius: 4px;
}

.brand-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: -2px;
}

.brand-text span {
    font-size: 0.72rem;
    color: #7d8f85;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: #9cb0a5;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link i {
    width: 20px;
    height: 20px;
    color: #5e7368;
    transition: color 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.nav-link:hover i {
    color: #ffffff;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-left: 3px solid #34d399;
    padding-left: 13px;
}

.nav-link.active i {
    color: #34d399;
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid rgba(184, 196, 189, 0.15);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #11402f;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-email {
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    width: fit-content;
    margin-top: 2px;
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Top Header */
.top-header {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background-color: var(--bg-sidebar);
    color: #ffffff;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle-btn {
    display: none;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.top-header h2 {
    font-size: 1.25rem;
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* Responsive sidebar toggles */
@media (max-width: 992px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        width: 280px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-toggle-btn {
        display: inline-flex;
    }
}

/* Tab 1: Dashboard Styles */
.welcome-banner {
    padding: 32px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, rgba(255, 255, 255, 0.05) 100%), var(--bg-card);
}

.banner-text h3 {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.banner-text p {
    color: var(--text-secondary);
}

.banner-date {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    gap: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-focus);
    background-color: #ffffff;
}
.dark-mode .stat-card:hover {
    background-color: var(--bg-input);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    width: 24px;
    height: 24px;
}

.stat-info {
    flex: 1;
}

.stat-info h4 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.stat-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    min-height: 40px;
}

.stat-action {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-action i {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.stat-card:hover .stat-action i {
    transform: translateX(4px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* Tables Styles */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th, .table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    background-color: rgba(0, 0, 0, 0.01);
}
.dark-mode .table th {
    background-color: rgba(255, 255, 255, 0.01);
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.005);
}
.dark-mode .table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.005);
}

/* Personal Income Tax Wizard */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.01);
}
.dark-mode .wizard-steps {
    background: rgba(255, 255, 255, 0.01);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    position: relative;
    cursor: pointer;
}

.step::after {
    content: '';
    position: absolute;
    top: 18px;
    left: calc(50% + 18px);
    width: calc(100% - 36px);
    height: 2px;
    background-color: var(--border-color);
    z-index: 1;
}

.step:last-child::after {
    display: none;
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    z-index: 2;
    transition: all 0.2s ease;
}

.step-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

.step.active .step-num {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    color: #ffffff;
}

.step.active .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

.step.completed .step-num {
    border-color: var(--color-success);
    background-color: var(--color-success);
    color: #ffffff;
}

@media (max-width: 576px) {
    .wizard-steps {
        padding: 16px 8px;
    }
    
    .step-label {
        display: none;
    }
}

.wizard-step-content {
    padding: 32px;
}

.step-title {
    font-size: 1.25rem;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.children-inputs {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.01);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.input-subgroup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sub-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.input-subgroup input {
    width: 80px;
    padding: 6px;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.action-right-group {
    display: flex;
    gap: 12px;
}

/* Results Display Dashboard */
.results-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.results-badge {
    background-color: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid rgba(22, 163, 74, 0.2);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.results-dashboard {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
}

@media (max-width: 992px) {
    .results-dashboard {
        grid-template-columns: 1fr;
    }
}

.tax-due-card {
    background: linear-gradient(135deg, #0b2e22 0%, #15513b 100%);
    color: #ffffff;
    border-radius: var(--radius-md);
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.tax-due-card::after {
    content: '';
    position: absolute;
    right: -50px;
    bottom: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.card-detail {
    margin-bottom: 32px;
}

.card-detail span {
    font-size: 0.95rem;
    opacity: 0.8;
}

.card-detail h2 {
    font-size: 2.5rem;
    margin-top: 8px;
    font-weight: 700;
}

.card-meta {
    display: flex;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.meta-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 16px;
}

.meta-item:first-child {
    padding-left: 0;
}

.meta-item span {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 4px;
}

.meta-item strong {
    font-size: 1.3rem;
}

.chart-container-wrapper {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-container-wrapper h4 {
    margin-bottom: 16px;
    align-self: flex-start;
}

.chart-box {
    width: 100%;
    max-width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Detail Table Styles */
.summary-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: 12px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

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

.indent-1 {
    padding-left: 32px !important;
}

.section-row {
    background-color: rgba(0, 0, 0, 0.02);
    font-weight: 600;
}
.dark-mode .section-row {
    background-color: rgba(255, 255, 255, 0.02);
}

.highlight-row {
    background-color: rgba(17, 64, 47, 0.02);
    font-weight: 500;
}
.dark-mode .highlight-row {
    background-color: rgba(37, 133, 98, 0.02);
}

.total-row {
    background-color: var(--color-primary-light);
    font-weight: 600;
}

.final-row {
    background-color: #0b2e22;
    color: #ffffff;
    font-weight: 600;
}
.dark-mode .final-row {
    background-color: #123d2e;
}

/* Brackets Visualizer Table */
.table-brackets {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
}

.table-brackets th, .table-brackets td {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
}

.table-brackets th {
    background-color: rgba(0, 0, 0, 0.02);
    font-weight: 600;
}
.dark-mode .table-brackets th {
    background-color: rgba(255, 255, 255, 0.02);
}

.table-brackets tr.highlight-bracket {
    background-color: var(--color-primary-light);
    font-weight: 600;
}

/* Withholding Tax & VAT Layouts */
.grid-layout-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 32px;
}

@media (max-width: 992px) {
    .grid-layout-2 {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.calc-panel {
    display: flex;
    flex-direction: column;
}

.panel-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.result-panel {
    border-left: 1px solid var(--border-color);
    padding-left: 32px;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 992px) {
    .result-panel {
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-left: 0;
        padding-top: 24px;
    }
}

.mini-stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
}

.mini-stat-card span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.mini-stat-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 4px;
}

.table-summary-rows {
    width: 100%;
    border-collapse: collapse;
}

.table-summary-rows th, .table-summary-rows td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.table-summary-rows th {
    text-align: left;
    color: var(--text-secondary);
}

.highlight-row-success {
    background-color: var(--color-success-light);
    font-weight: 600;
}

/* Radio Group Custom CSS */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label {
    cursor: pointer;
    position: relative;
    display: block;
}

.radio-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-custom-btn {
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease;
}

.radio-label input:checked + .radio-custom-btn {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(17, 64, 47, 0.1);
}

.radio-custom-btn strong {
    font-size: 0.95rem;
}

.radio-custom-btn span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* History Logs controls */
.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.history-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 576px) {
    .history-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .history-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Admin settings layout */
.admin-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-card {
    padding: 32px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.header-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon-box i {
    width: 24px;
    height: 24px;
}

.table-settings {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.table-settings th, .table-settings td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.9rem;
}

.table-settings input {
    width: 100%;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
}

/* Print CSS Stylesheet */
@page {
    size: A4;
    margin: 14mm;
}

@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    
    .sidebar, .top-header, .wizard-steps, .wizard-actions, .print-hidden, .results-badge {
        display: none !important;
    }
    
    .app-layout {
        display: block !important;
    }
    
    .main-content {
        height: auto !important;
        overflow: visible !important;
    }
    
    .content-scroll {
        padding: 0 !important;
        overflow: visible !important;
    }
    
    .glass {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    
    .results-dashboard {
        display: block !important;
    }
    
    .tax-due-card {
        background: #f1f5f9 !important;
        color: #000000 !important;
        border: 2px solid #cbd5e1 !important;
        page-break-inside: avoid;
    }
    
    .meta-item strong {
        color: #000000 !important;
    }
    
    .chart-container-wrapper {
        display: none !important;
    }
    
    .summary-table-wrapper {
        border: 1px solid #000000 !important;
    }
    
    .summary-table td {
        border-bottom: 1px solid #e2e8f0 !important;
        color: #000000 !important;
    }
    
    .section-row {
        background-color: #f8fafc !important;
    }
    
    .final-row {
        background-color: #f1f5f9 !important;
        color: #000000 !important;
        border-top: 2px double #000000 !important;
        font-size: 1.1rem !important;
    }
    
    .print-report-container {
        display: block !important;
        padding: 20px;
    }

    body.is-printing-report .app-layout {
        display: none !important;
    }

    body.is-printing-report .print-report-container {
        display: block !important;
        padding: 0 !important;
    }
}

.print-report-container {
    display: none;
}

.pdf-report {
    color: #0b1c16;
    font-family: var(--font-thai), var(--font-num), sans-serif;
    font-size: 12px;
    line-height: 1.45;
}

.pdf-report-header {
    border-bottom: 2px solid #11402f;
    margin-bottom: 18px;
    padding-bottom: 10px;
    text-align: center;
}

.pdf-report-header h1 {
    color: #11402f;
    font-size: 22px;
    margin: 0 0 4px 0;
}

.pdf-report-meta {
    background: #f2f5f3;
    border: 1px solid #b8c4bd;
    border-radius: 6px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
    padding: 12px;
}

.pdf-report-section-title {
    border-bottom: 1px solid #b8c4bd;
    color: #11402f;
    font-size: 15px;
    margin: 20px 0 8px 0;
    padding-bottom: 4px;
}

.pdf-report-table {
    border-collapse: collapse;
    margin-bottom: 16px;
    width: 100%;
}

.pdf-report-table th,
.pdf-report-table td {
    border: 1px solid #b8c4bd;
    padding: 7px 9px;
    vertical-align: top;
}

.pdf-report-table th {
    background: #e8f0eb;
    color: #0b2e22;
    font-weight: 700;
}

.pdf-report-total {
    background: #0b2e22;
    color: #ffffff;
    font-weight: 700;
}

.pdf-report-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 42px;
}

.pdf-signature-box {
    text-align: center;
    width: 220px;
}
