@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    font-family: var(--font-sans);
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --yellow-accent: #ffd000;
    --yellow-header: #fff200;
    
    --data-bg: #8ecae6;
    --wizard-bg: #f7d6c8;
    --report-bg: #c7e9b4;
    --config-bg: #cbd5e1;
    
    --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);
}

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

body {
    font-family: var(--font-sans);
    background-color: #f1f5f9;
    color: #1e293b;
    padding: 20px;
    min-height: 100vh;
}

.app-container {
    max-width: 1300px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    background-color: #0f172a;
    border-bottom: 2px solid #334155;
    padding: 10px 20px 0 20px;
}

.tab-btn {
    background: none;
    border: none;
    outline: none;
    color: #94a3b8;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    transition: all 0.2s ease;
    margin-right: 4px;
}

.tab-btn:hover {
    color: #f8fafc;
    background-color: #1e293b;
}

.tab-btn.active {
    color: #0f172a;
    background-color: #f1f5f9;
    font-weight: 600;
}

.tab-btn.active.tab-data-entry {
    background-color: var(--data-bg);
}

.tab-btn.active.tab-report-wizard {
    background-color: var(--wizard-bg);
}

.tab-btn.active.tab-report-format {
    background-color: var(--report-bg);
}

.tab-btn.active.tab-configuration {
    background-color: var(--config-bg);
}

/* Tab Contents */
.tab-content {
    display: none;
    padding: 0;
}

.tab-content.active {
    display: block;
}

/* Title Bars */
.title-bar {
    background-color: #ffff00; /* Bright yellow */
    color: #000000;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 1px solid #000000;
}

/* UI Panel Wrappers */
.ui-panel {
    padding: 20px;
    min-height: 500px;
}

.panel-data-entry {
    background-color: var(--data-bg);
}

.panel-report-wizard {
    background-color: var(--wizard-bg);
}

.panel-report-format {
    background-color: var(--report-bg);
}

.panel-configuration {
    background-color: var(--config-bg);
}

/* Top Details Grid Table */
.top-details-grid {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 24px;
}

.top-details-grid td {
    border: 1px solid #000000;
    padding: 4px 8px;
    vertical-align: middle;
}

.top-details-grid .grid-label {
    font-weight: bold;
    color: #000000;
    width: 120px;
    background-color: transparent;
    border: 1px solid #000000;
}

.top-details-grid .grid-input-cell {
    background-color: #ffffff;
    width: 250px;
    padding: 0;
    border: 1px solid #000000;
}

.top-details-grid .grid-input-cell input,
.top-details-grid .grid-input-cell select {
    width: 100%;
    height: 32px;
    border: none;
    padding: 4px 8px;
    outline: none;
    font-family: var(--font-sans);
    font-size: 14px;
    background-color: #ffffff;
}

.top-details-grid .grid-spacer {
    width: auto;
    border: none;
    background-color: transparent;
}

.top-details-grid .grid-empty-right {
    border: none;
    background-color: transparent;
}

.top-details-grid .grid-empty-spacer {
    height: 15px;
    border: none;
    background-color: transparent;
}

/* Spacer Column (Gap) */
.spacer-col-header, .spacer-col {
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    background-color: transparent !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    padding: 0 !important;
}

/* Main UI sections layout */
.reading-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    margin-top: 30px;
}

.billing-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.billing-type-header .section-title {
    margin-bottom: 0;
}

/* Billing Type / Equipment Table Grid Layout */
.section-title {
    font-weight: 600;
    color: #000000;
    margin-bottom: 12px;
    font-size: 16px;
    text-align: center;
}

/* Grid-based data entry sheet */
.reading-grid-container {
    background-color: #ffffff;
    border: 1px solid #000000;
    overflow: hidden;
    margin-bottom: 24px;
}

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

.reading-table th {
    background-color: #ffffff;
    color: #000000;
    font-weight: 700;
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #000000;
    text-align: center;
}

.reading-table td {
    padding: 4px 6px;
    border: 1px solid #000000;
    background-color: #ffffff;
}

/* Numerical cell formatting */
.cell-center {
    text-align: center;
}

.cell-right {
    text-align: right;
}

.input-cell {
    border: none;
    padding: 4px 8px;
    font-family: var(--font-sans);
    font-size: 14px;
    width: 100%;
    outline: none;
    text-align: right;
}

.input-cell:focus {
    background-color: #f8fafc;
}

.input-cell:disabled {
    background-color: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.label-cell {
    font-weight: bold;
    color: #000000;
    padding-left: 12px !important;
}

/* Action Buttons Footer */
.actions-footer {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 20px;
}

.btn {
    padding: 6px 20px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid #000000;
    border-radius: 0px;
    cursor: pointer;
    font-family: var(--font-sans);
    letter-spacing: 0.5px;
    color: #000000 !important; /* Ensure text is bold black */
    transition: background-color 0.1s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-edit {
    background-color: #e8a7d7; /* Light Magenta/Purple */
}

.btn-post {
    background-color: #f59e0b; /* Yellow/Orange */
}

.btn-generate {
    background-color: #c2410c; /* Brownish Orange */
}

.btn-export {
    background-color: #ff0000; /* Bright Red */
}

/* Notification Overlay */
.toast-msg {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #1e293b;
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    font-weight: 500;
    display: none;
    border-left: 6px solid var(--yellow-accent);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Report Wizard Grid layout */
.wizard-grid {
    border: 1px solid #000000;
    background-color: #ffffff;
    width: 100%;
    border-collapse: collapse;
}

.wizard-grid th {
    background-color: #ffffff;
    color: #000000;
    padding: 6px 10px;
    border: 1px solid #000000;
    text-align: center;
}

.wizard-grid td {
    padding: 0;
    border: 1px solid #000000;
}

.wizard-grid input {
    width: 100%;
    height: 32px;
    border: none;
    padding: 4px 8px;
    outline: none;
    font-family: var(--font-sans);
    font-size: 14px;
    background-color: #ffffff;
}

.wizard-grid td.chk-container {
    padding: 4px 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wizard-label {
    font-weight: bold;
    color: #000000;
    width: 180px;
    padding: 4px 8px !important;
}

.chk-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.chk-box {
    width: 18px;
    height: 18px;
    accent-color: #004d80; /* dark blue */
    cursor: pointer;
}

/* Report View Layout styling */
.report-view-container {
    overflow-x: auto;
    border: 1px solid #000000;
    background-color: #ffffff;
    max-height: 600px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.report-table th {
    background-color: #86efac;
    color: #000000;
    font-weight: bold;
    padding: 6px 8px;
    border: 1px solid #000000;
    text-align: center;
    white-space: nowrap;
}

.report-table td {
    padding: 6px 8px;
    border: 1px solid #000000;
    white-space: nowrap;
    background-color: #c7e9b4; /* match panel background */
}

.report-table tr:nth-child(even) td {
    background-color: #c7e9b4;
}

.report-table tr:hover td {
    background-color: #bbf7d0;
}

.report-table tr.total-row td {
    background-color: #c7e9b4;
    font-weight: bold;
    border-top: 1px solid #000000;
    border-bottom: 1px solid #000000;
    color: #000000;
}

/* Billing Type Options in Report Wizard */
.billing-type-opt-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 15px;
}

.billing-type-label {
    font-weight: bold;
    color: #000000;
    width: 120px;
}

.billing-type-box {
    background-color: #ffffff;
    border: 1px solid #000000;
    padding: 10px 16px;
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Configuration Tab Sub-sections styling */
.config-tab-content {
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.config-subtab-btn.active {
    background-color: #cbd5e1 !important;
    border-bottom: 2px solid #0f172a !important;
}

.config-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.config-search {
    padding: 8px;
    width: 250px;
    border: 2px solid #000;
    border-radius: 4px;
}

/* Login Modal Overlay */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-modal-card {
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    width: 380px;
    max-width: 90%;
    padding: 30px;
}

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

.login-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-header p {
    font-size: 13px;
    color: #64748b;
}

.login-field {
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.login-field input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #000000;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    outline: none;
}

.login-field input:focus {
    border-color: #e879f9;
}

.login-role-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.role-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: #475569;
}

.login-error-msg {
    color: #ef4444;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
    background: #fef2f2;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #fca5a5;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #000000;
    color: #ffffff;
    font-weight: 800;
    font-size: 15px;
    border: 2px solid #000000;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.15s ease;
}

.btn-login:hover {
    background: #334155;
}

.user-session-bar {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    background: #000000;
    color: #ffffff;
    border-radius: 20px;
}

.btn-logout {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    background: #ef4444;
    color: #ffffff;
    border: 1px solid #000000;
    border-radius: 4px;
    cursor: pointer;
}

.btn-logout:hover {
    background: #dc2626;
}
