/* eMicrofin - Enterprise Design Tokens & Theme Engine */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #6366f1;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-surface-hover: #334155;
    --border-color: #334155;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --sidebar-width: 250px;
    --navbar-height: 60px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

/* Light Theme Variables */
body.light-theme {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --border-color: #e2e8f0;

    --text-main: #0f172a;
    --text-muted: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    width: 100vw;
    display: flex;
    overflow-x: hidden;
}

/* Layout Architecture - Full Width Screen Responsiveness */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

/* Day Mode Sidebar Main Menu Alignment */
body.light-theme .sidebar {
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
}

.sidebar-header {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
}

.brand-title {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .brand-title {
    background: linear-gradient(135deg, #0f172a, #334155);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
}

body.light-theme .nav-item {
    color: #64748b;
}

body.light-theme .nav-item:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nav-item svg {
    width: 18px;
    height: 18px;
}

.main-wrapper {
    margin-left: var(--sidebar-width);
    width: calc(100vw - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.navbar {
    height: var(--navbar-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 90;
    width: 100%;
    max-width: 100%;
}

.navbar-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.content-body {
    padding: 1.25rem 1.5rem;
    width: 100%;
    max-width: 100%;
    flex: 1;
}

/* Cards & Containers - 100% Full Width Expansiveness */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.stat-info h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.info {
    background-color: rgba(6, 182, 212, 0.1);
    color: var(--info);
}

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

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.85rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
}

/* Premium Action Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
}
.btn-primary:hover {
    opacity: 0.95;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
}

/* ─── Premium Micro Action Buttons (all modules) ─────────────────────────── */

/* Base shared style */
.btn-action-edit,
.btn-action-delete,
.btn-action-deposit,
.btn-action-withdraw,
.btn-action-passbook {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    padding: 0.26rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.02em;
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease, color 0.18s ease;
    line-height: 1.4;
    text-decoration: none;
}
.btn-action-edit:active,
.btn-action-delete:active,
.btn-action-deposit:active,
.btn-action-withdraw:active,
.btn-action-passbook:active {
    transform: scale(0.96);
}

/* ✏️ Edit — Blue */
.btn-action-edit {
    color: #60a5fa;
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.28);
}
.btn-action-edit:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
}

/* 🗑️ Delete — Red */
.btn-action-delete {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
}
.btn-action-delete:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);
}

/* ➕ Deposit — Emerald green */
.btn-action-deposit {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
}
.btn-action-deposit:hover {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

/* ➖ Withdraw — Amber orange */
.btn-action-withdraw {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
}
.btn-action-withdraw:hover {
    background: #f59e0b;
    color: #ffffff;
    border-color: #f59e0b;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
}

/* 📖 Passbook — Indigo violet */
.btn-action-passbook {
    color: #a78bfa;
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.25);
}
.btn-action-passbook:hover {
    background: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
}

/* Action group wrapper — keeps buttons tight and aligned */
.action-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: nowrap;
}


.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-logout:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Premium Tab Navigation Bar (Accounting, Reports & Multi-Tab Views) */
.report-tabs-nav {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-main);
    padding: 0.4rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}

.report-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.report-tab-btn:hover {
    color: var(--text-main);
    background: var(--bg-surface-hover);
}

.report-tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    font-weight: 700;
}

body.light-theme .report-tabs-nav {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

body.light-theme .report-tab-btn {
    color: #64748b;
}

body.light-theme .report-tab-btn:hover {
    color: #0f172a;
    background: #ffffff;
}

body.light-theme .report-tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

/* Data Table Architecture - 100% Full Width Screen Responsiveness */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}

.data-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--bg-main);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background-color: var(--bg-surface-hover);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-danger  { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-info    { background: rgba(6, 182, 212, 0.15); color: var(--info); }
.badge-secondary{ background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }

/* Modal Architecture */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Toast Notifications */
#toast-container,
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: calc(100vw - 3rem);
}

.toast {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-info    { border-left: 4px solid var(--info); }

/* Premium Glassmorphic Login Card */
.login-container {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    padding: 1.5rem;
    box-sizing: border-box;
    position: relative;
    overflow-x: hidden;
}

body.light-theme .login-container {
    background: radial-gradient(circle at 50% 50%, #ffffff 0%, #f1f5f9 100%);
}

.login-card {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 2.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

body.light-theme .login-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body.light-theme #login-error-alert {
    background: #fef2f2 !important;
    border-color: #f87171 !important;
    color: #dc2626 !important;
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 1.4rem;
    margin: 0 auto 0.75rem auto;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.login-title {
    font-size: 1.4rem;
    font-weight: 800;
}

.login-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.demo-pill {
    padding: 0.3rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

/* Stepper & Workspace Window Redesign */
.stepper-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 0.85rem;
    padding: 0.25rem 0;
}
.stepper-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 8%;
    right: 8%;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
    transform: translateY(-50%);
}
.stepper-step {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-card);
    padding: 0.25rem 0.55rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.stepper-step .stepper-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-main);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
}
.stepper-step .stepper-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}
.stepper-step.completed {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.12);
}
.stepper-step.completed .stepper-dot {
    background: var(--success);
    color: #ffffff;
}
.stepper-step.completed .stepper-label {
    color: var(--success);
}
.stepper-step.active {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.15);
}
.stepper-step.active .stepper-dot {
    background: var(--primary);
    color: #ffffff;
}
.stepper-step.active .stepper-label {
    color: var(--primary);
}

/* Glassmorphic Workspace Tab Navigation Bar */
.workspace-tabs-bar {
    display: flex;
    gap: 0.35rem;
    background: var(--bg-main);
    padding: 0.3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 0.85rem;
}
.workspace-tabs-bar .ws-tab-btn {
    flex: 1;
    text-align: center;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.workspace-tabs-bar .ws-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

