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

:root {
    --bg-main: #0f1013;
    --bg-card: #17191e;
    --bg-input: #1f2229;
    --border-color: #2e3440;
    
    --text-primary: #f5f6f9;
    --text-secondary: #a0a6b2;
    --text-muted: #676e7b;
    
    --gold-bright: #ffd700;
    --gold-gradient: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
    --gold-glow: 0 0 15px rgba(255, 215, 0, 0.2);
    
    --success: #2ecc71;
    --error: #e74c3c;
    --info: #3498db;
    
    --font-sans: 'Outfit', sans-serif;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 4px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    padding: 0.5rem 1.5rem 1.5rem 1.5rem;
    min-height: 100vh;
}

/* App Layout */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
}

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

.logo-section h1 {
    font-size: 1.35rem;
    font-weight: 700;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.logo-section p {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.system-status {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
}

.status-badge {
    background: var(--bg-card);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* Form Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 0;
}

@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gold-gradient);
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gold-bright);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Fields Styling */
.fields-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select, textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    width: 100%;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold-bright);
    box-shadow: var(--gold-glow);
}

input[readonly] {
    background: rgba(46, 52, 64, 0.3);
    color: var(--text-secondary);
    cursor: not-allowed;
    border-style: dashed;
}

/* Field Suffixes/Icons */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-suffix {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
    font-weight: 600;
}

.input-wrapper input {
    padding-right: 3rem;
}

/* Buttons */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.btn-primary {
    background: var(--gold-gradient);
    color: #000;
    box-shadow: var(--gold-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

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

/* Recent Entries Section */
.ledger-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.8rem 1.2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.ledger-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gold-bright);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: auto;
}

.grid-date-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.grid-date-filter:focus-within {
    border-color: var(--gold-bright);
    box-shadow: var(--gold-glow);
}

.grid-date-filter label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold-bright);
}

.grid-date-filter input[type="date"] {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0;
    width: auto;
    font-size: 0.9rem;
    font-family: var(--font-sans);
    cursor: pointer;
}

.grid-date-filter input[type="date"]:focus {
    box-shadow: none;
    outline: none;
}

.record-count-badge {
    background: rgba(255, 215, 0, 0.15);
    color: var(--gold-bright);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.ledger-actions {
    display: flex;
    gap: 0.75rem;
}

.ledger-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 220px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

th {
    background: var(--bg-input);
    color: var(--gold-bright);
    padding: 0.2rem 0.4rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 0.2rem 0.4rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

tr:hover td {
    color: var(--text-primary);
    background: rgba(255, 215, 0, 0.03);
}

tr.empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
}

/* Badge tags for DR/CR */
.badge {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-dr {
    background-color: rgba(46, 204, 113, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge-cr {
    background-color: rgba(231, 76, 60, 0.15);
    color: var(--error);
    border: 1px solid var(--error);
}

/* Modal / SQL Overlay */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--gold-bright);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), var(--gold-glow);
    z-index: 100;
    transform: translateY(150%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toast.show {
    transform: translateY(0);
}

.toast-success {
    border-color: var(--success);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 10px rgba(46, 204, 113, 0.2);
}

/* Custom scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold-bright);
}

/* Align numeric values to the right for financial grid standards */
#entriesTable th:nth-child(5), #entriesTable td:nth-child(5),
#entriesTable th:nth-child(6), #entriesTable td:nth-child(6),
#entriesTable th:nth-child(7), #entriesTable td:nth-child(7),
#entriesTable th:nth-child(8), #entriesTable td:nth-child(8),
#entriesTable th:nth-child(10), #entriesTable td:nth-child(10),
#entriesTable th:nth-child(11), #entriesTable td:nth-child(11),
#entriesTable th:nth-child(12), #entriesTable td:nth-child(12),
#headerTable th:nth-child(5), #headerTable th:nth-child(6),
#headerTable th:nth-child(7), #headerTable th:nth-child(8),
#headerTable th:nth-child(10), #headerTable th:nth-child(11),
#headerTable th:nth-child(12),
#totalsTable td:nth-child(5), #totalsTable td:nth-child(6),
#totalsTable td:nth-child(7), #totalsTable td:nth-child(8),
#totalsTable td:nth-child(10), #totalsTable td:nth-child(11),
#totalsTable td:nth-child(12) {
    text-align: right;
}

/* Account Ledger column alignment */
#ledgerHeadTable th:nth-child(4), #ledgerHeadTable th:nth-child(5),
#ledgerHeadTable th:nth-child(6), #ledgerHeadTable th:nth-child(7),
#ledgerHeadTable th:nth-child(8), #ledgerHeadTable th:nth-child(9), #ledgerHeadTable th:nth-child(10),
#ledgerHeadTable th:nth-child(12), #ledgerHeadTable th:nth-child(13), #ledgerHeadTable th:nth-child(14),
#ledgerBodyTable td:nth-child(4), #ledgerBodyTable td:nth-child(5),
#ledgerBodyTable td:nth-child(6), #ledgerBodyTable td:nth-child(7),
#ledgerBodyTable td:nth-child(8), #ledgerBodyTable td:nth-child(9), #ledgerBodyTable td:nth-child(10),
#ledgerBodyTable td:nth-child(12), #ledgerBodyTable td:nth-child(13), #ledgerBodyTable td:nth-child(14),
#ledgerFooterTable td:nth-child(4), #ledgerFooterTable td:nth-child(5),
#ledgerFooterTable td:nth-child(6), #ledgerFooterTable td:nth-child(7),
#ledgerFooterTable td:nth-child(8), #ledgerFooterTable td:nth-child(9), #ledgerFooterTable td:nth-child(10),
#ledgerFooterTable td:nth-child(12), #ledgerFooterTable td:nth-child(13), #ledgerFooterTable td:nth-child(14) {
    text-align: right;
}

/* Trial Balance numeric column alignment */
#trialHeadTable th:nth-child(4), #trialHeadTable th:nth-child(5),
#trialHeadTable th:nth-child(6), #trialHeadTable th:nth-child(7), #trialHeadTable th:nth-child(8), #trialHeadTable th:nth-child(9),
#trialTable td:nth-child(4), #trialTable td:nth-child(5),
#trialTable td:nth-child(6), #trialTable td:nth-child(7), #trialTable td:nth-child(8), #trialTable td:nth-child(9),
#trialFooterTable td:nth-child(4), #trialFooterTable td:nth-child(5),
#trialFooterTable td:nth-child(6), #trialFooterTable td:nth-child(7), #trialFooterTable td:nth-child(8), #trialFooterTable td:nth-child(9) {
    text-align: right;
}

/* Explicit left justification for account heads in Trial Balance */
#trialHeadTable th:nth-child(3),
#trialTable td:nth-child(3) {
    text-align: left !important;
}

/* Group Trial Balance numeric column alignment */
#groupTrialHeadTable th:nth-child(3), #groupTrialHeadTable th:nth-child(4),
#groupTrialHeadTable th:nth-child(5), #groupTrialHeadTable th:nth-child(6), #groupTrialHeadTable th:nth-child(7), #groupTrialHeadTable th:nth-child(8),
#groupTrialTable td:nth-child(3), #groupTrialTable td:nth-child(4),
#groupTrialTable td:nth-child(5), #groupTrialTable td:nth-child(6), #groupTrialTable td:nth-child(7), #groupTrialTable td:nth-child(8),
#groupTrialFooterTable td:nth-child(3), #groupTrialFooterTable td:nth-child(4),
#groupTrialFooterTable td:nth-child(5), #groupTrialFooterTable td:nth-child(6), #groupTrialFooterTable td:nth-child(7), #groupTrialFooterTable td:nth-child(8) {
    text-align: right;
}

/* Explicit left justification for account groups in Group Trial Balance */
#groupTrialHeadTable th:nth-child(2),
#groupTrialTable td:nth-child(2) {
    text-align: left !important;
}

/* Item Ledger numeric column alignment */
#itemLedgerHeadTable th:nth-child(5), #itemLedgerHeadTable th:nth-child(6),
#itemLedgerHeadTable th:nth-child(7), #itemLedgerHeadTable th:nth-child(8),
#itemLedgerHeadTable th:nth-child(9), #itemLedgerHeadTable th:nth-child(10), #itemLedgerHeadTable th:nth-child(11),
#itemLedgerBodyTable td:nth-child(5), #itemLedgerBodyTable td:nth-child(6),
#itemLedgerBodyTable td:nth-child(7), #itemLedgerBodyTable td:nth-child(8),
#itemLedgerBodyTable td:nth-child(9), #itemLedgerBodyTable td:nth-child(10), #itemLedgerBodyTable td:nth-child(11),
#itemLedgerFooterTable td:nth-child(5), #itemLedgerFooterTable td:nth-child(6),
#itemLedgerFooterTable td:nth-child(7), #itemLedgerFooterTable td:nth-child(8),
#itemLedgerFooterTable td:nth-child(9), #itemLedgerFooterTable td:nth-child(10), #itemLedgerFooterTable td:nth-child(11) {
    text-align: right;
}

/* Item Trial numeric column alignment */
#itemTrialHeadTable th:nth-child(2), #itemTrialHeadTable th:nth-child(3),
#itemTrialHeadTable th:nth-child(4), #itemTrialHeadTable th:nth-child(5), #itemTrialHeadTable th:nth-child(6),
#itemTrialBodyTable td:nth-child(2), #itemTrialBodyTable td:nth-child(3),
#itemTrialBodyTable td:nth-child(4), #itemTrialBodyTable td:nth-child(5), #itemTrialBodyTable td:nth-child(6),
#itemTrialFooterTable td:nth-child(2), #itemTrialFooterTable td:nth-child(3),
#itemTrialFooterTable td:nth-child(4), #itemTrialFooterTable td:nth-child(5), #itemTrialFooterTable td:nth-child(6) {
    text-align: right;
}

/* Active row bar highlight */
tbody tr {
    cursor: pointer;
    transition: var(--transition);
}

tr.active-row td {
    background: rgba(255, 215, 0, 0.08) !important;
    color: var(--text-primary) !important;
}

tr.active-row td:first-child {
    border-left: 4px solid var(--gold-bright) !important;
    padding-left: calc(0.5rem - 4px) !important; /* prevent content shifting */
}

/* Prevent table text wrapping */
.ledger-table-container th {
    white-space: nowrap;
    position: relative !important;
    padding-right: 18px !important;
}
.ledger-table-container td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Table Column Resizer Styles */
.col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    z-index: 5;
}
.col-resizer:hover,
.col-resizer.resizing {
    border-right: 2px solid var(--gold-bright);
}

/* Table Footer (Totals Row) */
tfoot {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: var(--bg-card);
}

tr.totals-row td {
    background: var(--bg-input);
    color: var(--text-primary);
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--gold-bright);
    font-weight: 700;
    padding: 0.4rem 0.5rem;
}

/* Tab Navigation Styles */
.tab-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.tab-button {
    padding: 0.4rem 1rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.tab-button:hover {
    color: var(--gold-bright);
    border-color: var(--gold-bright);
    background: var(--bg-input);
}

.tab-button.active {
    color: #000;
    background: var(--gold-gradient);
    border-color: var(--gold-bright);
    box-shadow: var(--gold-glow);
}

/* Tab Panel Styles */
.tab-panel {
    width: 100%;
}

/* Trial and Group Trial table cell alignments */
#trialTable th:nth-child(3), #trialTable td:nth-child(3),
#trialTable th:nth-child(4), #trialTable td:nth-child(4),
#trialTable th:nth-child(5), #trialTable td:nth-child(5),
#trialTable th:nth-child(6), #trialTable td:nth-child(6) {
    text-align: right;
}

#groupTrialTable th:nth-child(2), #groupTrialTable td:nth-child(2),
#groupTrialTable th:nth-child(3), #groupTrialTable td:nth-child(3),
#groupTrialTable th:nth-child(4), #groupTrialTable td:nth-child(4),
#groupTrialTable th:nth-child(5), #groupTrialTable td:nth-child(5) {
    text-align: right;
}

/* Selected Voucher Details Grid Boxes */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.detail-box {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 38px;
}

.detail-box.full-width {
    grid-column: 1 / -1;
    min-height: auto;
    padding: 0.5rem 0.6rem;
}

.detail-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.detail-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-box.full-width .detail-value {
    white-space: normal;
    word-break: break-word;
}

/* Day Book Balances Header Badge */
.ledger-balances-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 215, 0, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    margin-right: auto;
    margin-left: 1rem;
}
.balance-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}
.balance-label {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}
.balance-val {
    font-weight: 600;
    font-size: 0.8rem;
}
.balance-val.amount {
    color: var(--text-primary);
}
.balance-val.qty {
    color: var(--gold-bright);
}
.balance-divider {
    width: 1px;
    height: 14px;
    background-color: var(--border-color);
}

/* Excel-like Column Filter Styles */
.filter-icon {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: var(--transition);
    z-index: 4;
}
.filter-icon:hover {
    color: var(--gold-bright);
}
.filter-icon.active {
    color: var(--gold-bright) !important;
    font-weight: bold;
}

.filter-popover {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6), var(--gold-glow);
    border-radius: var(--radius-md);
    padding: 0.6rem;
    z-index: 10000;
    width: 210px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.filter-search {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    width: 100%;
}
.filter-options-list {
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-right: 0.25rem;
}
.filter-option-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-primary);
    cursor: pointer;
    width: 100%;
}
.filter-option-item input {
    cursor: pointer;
    margin: 0;
    width: 14px !important;
    height: 14px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}
.filter-option-item label {
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
    text-align: left;
    flex: 1;
    color: var(--text-primary) !important;
}
.filter-popover-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
}
.filter-popover-actions button {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.filter-btn-clear {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}
.filter-btn-clear:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}
.filter-btn-apply {
    background: var(--gold-gradient);
    border: none;
    color: #000;
}
.filter-btn-apply:hover {
    box-shadow: var(--gold-glow);
}

/* Custom Login Overlay Styles */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1715 0%, #080706 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
}
.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.login-card {
    background: rgba(28, 25, 23, 0.65);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(212, 175, 55, 0.18);
    padding: 2.75rem 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 390px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.05);
    text-align: center;
    box-sizing: border-box;
    animation: loginCardFadeIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.login-header {
    margin-bottom: 2.25rem;
}
.login-logo {
    font-size: 2.3rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.25));
}
.login-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 500;
}
.login-input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}
.login-input-group label {
    display: block;
    font-size: 0.72rem;
    color: var(--gold-bright);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}
.login-input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(12, 10, 9, 0.65);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.login-input-group input:focus {
    outline: none;
    border-color: var(--gold-bright);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.18);
    background: rgba(12, 10, 9, 0.85);
}
.login-error-message {
    color: var(--error);
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
    min-height: 18px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.2px;
}
.login-submit-btn {
    width: 100%;
    padding: 0.85rem;
    background: var(--gold-gradient);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: 750;
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-sizing: border-box;
    transition: transform 0.15s, box-shadow 0.3s, filter 0.3s;
}
.login-submit-btn:hover {
    box-shadow: var(--gold-glow);
    filter: brightness(1.1);
}
.login-submit-btn:active {
    transform: scale(0.98);
}
#logoutBtn:hover {
    background: rgba(212, 175, 55, 0.15) !important;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

@keyframes loginCardFadeIn {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.shake {
    animation: shake 0.4s ease-in-out;
}
