/* ==========================================================================
   BAKSO NUSANTARA - MODERN DESIGN SYSTEM (ON TOP OF BOOTSTRAP 5)
   ========================================================================== */

/* Custom properties & Bootstrap 5 variable overrides */
:root {
    /* Color Palette */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;        /* Slate 900 */
    --text-secondary: #475569;      /* Slate 600 */
    --text-muted: #64748b;          /* Slate 500 */
    
    --color-primary: #6366f1;       /* Indigo 500 */
    --color-primary-hover: #4f46e5; /* Indigo 600 */
    --color-secondary: #0ea5e9;     /* Sky 500 */
    --color-success: #10b981;       /* Emerald 500 */
    --color-warning: #f59e0b;       /* Amber 500 */
    --color-danger: #ef4444;        /* Rose 500 */
    --color-border: #e2e8f0;        /* Slate 200 */
    
    /* Sidebar Specific */
    --color-sidebar: #0f172a;       /* Slate 900 */
    --color-sidebar-text: #94a3b8;  /* Slate 400 */
    --color-sidebar-active: #38bdf8;/* Sky 400 */
    
    /* Layout Tokens */
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 1px 2px 0 rgba(15, 23, 42, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Bootstrap Global Variables Mapping */
    --bs-primary: #6366f1;
    --bs-primary-rgb: 99, 102, 241;
    --bs-success: #10b981;
    --bs-success-rgb: 16, 185, 129;
    --bs-danger: #ef4444;
    --bs-danger-rgb: 239, 68, 68;
    --bs-warning: #f59e0b;
    --bs-warning-rgb: 245, 158, 11;
    --bs-info: #0ea5e9;
    --bs-info-rgb: 14, 165, 233;
    
    --bs-body-font-family: var(--font-sans);
    --bs-body-bg: var(--bg-primary);
    --bs-body-color: var(--text-primary);
}

/* Reset & Base Elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Remove number input spinners / up-down arrows */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Layout */
.sidebar {
    width: 260px;
    background-color: var(--color-sidebar);
    color: #ffffff;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.sidebar-logo {
    max-height: 95px;
    width: 100%;
    max-width: 215px;
    height: auto;
    object-fit: contain;
    background: #ffffff;
    padding: 10px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-brand:hover .sidebar-logo {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.login-logo {
    max-height: 75px;
    max-width: 230px;
    height: auto;
    width: auto;
    object-fit: contain;
    background: #ffffff;
    padding: 8px 16px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
}

.sidebar-close {
    display: none !important; /* Strictly hidden on desktop */
    background: transparent;
    border: none;
    color: var(--color-sidebar-text);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.sidebar-close:hover {
    color: #ffffff;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-left: 0;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--color-sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.sidebar-item a span {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sidebar-item a:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    padding-left: 1.15rem; /* Slight shift effect */
}

.sidebar-item a:hover span {
    transform: scale(1.25) rotate(6deg);
}

.sidebar-item.active a {
    background: linear-gradient(135deg, var(--color-primary) 0%, #4f46e5 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(56, 189, 248, 0.15);
    border: 2px solid var(--color-sidebar-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--color-sidebar-active);
    font-size: 0.95rem;
}

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

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
}

.user-role {
    font-size: 0.75rem;
    color: var(--color-sidebar-text);
}

/* Main Content Page Container */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    width: calc(100% - 260px);
    max-width: 100%;
    transition: all 0.3s ease;
}

/* Header / Top Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.page-title-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.page-title p.subtitle-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Sidebar Toggle Trigger (Hidden on Desktop) */
.sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    cursor: pointer;
    z-index: 1100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-toggle:hover,
.sidebar-toggle:active {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    transform: scale(1.03);
}

.sidebar-toggle span {
    width: 22px;
    height: 2.5px;
    background-color: var(--text-primary);
    border-radius: 2px;
    display: block;
    pointer-events: none;
    transition: all 0.2s ease;
}

/* Sidebar Backdrop Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Panels (Bootstrap Card Override) */
.panel {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel:hover {
    box-shadow: var(--shadow-md);
}

.panel-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(248, 250, 252, 0.4);
}

.panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
}

.panel-body {
    padding: 1.75rem;
}

/* Buttons (Modern Design) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.18);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover) !important;
    border-color: var(--color-primary-hover) !important;
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.28);
}

.btn-secondary {
    background-color: #ffffff !important;
    color: var(--text-primary) !important;
    border-color: #cbd5e1 !important;
}

.btn-secondary:hover {
    background-color: #f8fafc !important;
    border-color: #94a3b8 !important;
}

.btn-success {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15) !important;
}

.btn-success:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.25) !important;
}

.btn-danger {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15) !important;
}

.btn-danger:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.25) !important;
}

/* Quick Actions and Secondary Buttons Hover Scale (WoW Effect) */
.panel-body a.btn-secondary, 
.panel-body button.btn-secondary {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-body a.btn-secondary:hover, 
.panel-body button.btn-secondary:hover {
    background-color: rgba(99, 102, 241, 0.05) !important;
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
    transform: translateY(-2.5px) scale(1.02);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.12);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

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

.stat-card {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card.success:hover {
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.15), var(--shadow-md);
}

.stat-card.warning:hover {
    box-shadow: 0 10px 20px -5px rgba(245, 158, 11, 0.15), var(--shadow-md);
}

.stat-card.danger:hover {
    box-shadow: 0 10px 20px -5px rgba(239, 68, 68, 0.15), var(--shadow-md);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.75px;
}

.stat-val {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 0.25rem;
    color: var(--text-primary);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background-color: rgba(99, 102, 241, 0.08);
    color: var(--color-primary);
}

.stat-card.success .stat-icon {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--color-success);
}

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

.stat-card.danger .stat-icon {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--color-danger);
}

/* Grid helper */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.form-control, select.form-control, textarea.form-control {
    display: block;
    width: 100%;
    padding: 0.55rem 0.875rem;
    font-size: 0.925rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: #a5b4fc;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

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

/* Tables (Professional SaaS layout) */
.table-wrapper {
    overflow-x: auto;
    margin: -1.75rem; /* negate panel-body padding */
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.table-wrapper th {
    background-color: #f1f5f9;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.85rem 1.25rem;
    border-bottom: 2px solid var(--color-border);
    border-top: none;
}

.table-wrapper td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--text-primary);
    vertical-align: middle;
    background-color: #ffffff;
}

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

.table-wrapper tr:hover td {
    background-color: rgba(99, 102, 241, 0.02) !important;
}

/* Grid table specifically for the attendance grid */
.grid-table {
    border-collapse: separate;
    border-spacing: 0;
}
.grid-table th, .grid-table td {
    border: 1px solid var(--color-border);
    padding: 0.6rem 0.5rem;
}

/* Badges Status */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: var(--color-success) !important;
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1) !important;
    color: var(--color-warning) !important;
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: var(--color-danger) !important;
}

.badge-info {
    background-color: rgba(14, 165, 233, 0.1) !important;
    color: var(--color-secondary) !important;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-success {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

/* Wizard / Production Workflow Steps */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
    gap: 1rem;
    overflow-x: auto;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 100px;
    text-align: center;
    position: relative;
    text-decoration: none;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--color-border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
    z-index: 2;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

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

.step-item.active .step-label {
    color: var(--color-primary);
}

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

.step-item.completed .step-label {
    color: var(--color-success);
}

/* Invoice View Design */
.invoice-container {
    background-color: #ffffff;
    padding: 3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    max-width: 800px;
    margin: 0 auto;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.invoice-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.invoice-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: right;
}

.invoice-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.invoice-party h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.invoice-table th {
    border-bottom: 2px solid var(--color-border);
    padding: 0.75rem 0;
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
}

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

.invoice-summary {
    display: flex;
    justify-content: flex-end;
}

.invoice-summary-box {
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.invoice-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.invoice-summary-row.total {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    border-top: 2px solid var(--color-border);
    padding-top: 0.5rem;
}

/* Setup Page Design */
.setup-wrapper {
    background: radial-gradient(circle at top right, #cffafe 0%, #f8fafc 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.setup-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    padding: 3rem;
    text-align: center;
}

.setup-terminal {
    background-color: #0f172a;
    color: #38bdf8;
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: 'Courier New', Courier, monospace;
    text-align: left;
    height: 300px;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 1.5rem 0;
    box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.6);
}

/* Global Footer */
.app-footer {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--color-border);
    background-color: var(--bg-secondary);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive Layout Breakpoints */

/* Desktop Screens (min-width: 1024px) */
@media (min-width: 1024px) {
    .sidebar {
        left: 0 !important;
        transform: none !important;
    }
    .app-footer {
        margin-left: 260px;
    }
}

/* Tablets and Mobile Devices (max-width: 1023px) */
@media (max-width: 1023px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        max-width: 85vw;
        z-index: 1050 !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }
    
    .sidebar-toggle {
        display: flex !important;
    }
    
    .sidebar-close {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff !important;
        font-size: 1.5rem;
        cursor: pointer;
        border: none;
        transition: background 0.2s ease;
    }

    .sidebar-close:hover,
    .sidebar-close:active {
        background: rgba(255, 255, 255, 0.25);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.25rem 1rem;
        transition: all 0.3s ease;
    }
    
    .app-footer {
        margin-left: 0;
        width: 100%;
    }
    
    /* Open Sidebar State */
    .app-container.sidebar-open .sidebar {
        transform: translateX(0) !important;
        box-shadow: 4px 0 25px rgba(15, 23, 42, 0.3) !important;
    }
    
    .app-container.sidebar-open .sidebar-overlay {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Mobile Screens (max-width: 768px) */
@media (max-width: 768px) {
    .top-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        padding: 1.25rem;
    }
    
    .page-title h1 {
        font-size: 1.35rem;
    }
    
    .page-title p.subtitle-text {
        font-size: 0.8rem;
    }
    
    .nav-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        width: 100%;
    }

    .currency-switcher {
        flex: 1;
        min-width: 120px;
    }

    .currency-switcher select {
        width: 100%;
    }

    .top-nav .nav-actions span {
        font-size: 0.8rem !important;
    }
    
    .main-content {
        padding: 1rem;
        gap: 1.25rem;
    }

    .stats-grid {
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-val {
        font-size: 1.4rem;
    }

    .panel-header {
        padding: 1rem 1.25rem;
    }

    .panel-body {
        padding: 1.25rem;
    }

    .wizard-steps {
        padding-bottom: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .invoice-container {
        padding: 1.5rem;
    }

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

    .invoice-meta {
        text-align: left;
    }

    .invoice-details {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ==========================================================================
   AUTHENTICATION PAGES (LOGIN / SETUP)
   ========================================================================== */
.auth-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2f6;
    padding: 1.5rem;
    font-family: var(--font-sans);
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background-color: rgba(255, 255, 255, 0.88);
    background-image: linear-gradient(rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.86)), url('../images/owner.jpg');
    background-size: cover;
    background-position: center top;
    border-radius: 20px;
    padding: 2.5rem 2rem 2rem 2rem;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    font-size: 1.85rem;
    font-weight: 800;
    color: #4f46e5;
    letter-spacing: -0.5px;
    line-height: 1.2;
    text-transform: uppercase;
}

.auth-logo span {
    color: #4f46e5;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
    margin-top: 0.4rem;
}

.auth-card .form-group {
    margin-bottom: 1.25rem;
}

.auth-card .form-label {
    display: block;
    font-weight: 700;
    color: #1e293b;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.auth-card .form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.auth-card .form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.auth-card .form-control::placeholder {
    color: #94a3b8;
}

.auth-card .btn-primary {
    width: 100%;
    background: #5850ec;
    border: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.85rem;
    border-radius: 10px;
    margin-top: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(88, 80, 236, 0.35);
}

.auth-card .btn-primary:hover {
    background: #4338ca;
    box-shadow: 0 6px 18px rgba(88, 80, 236, 0.45);
    transform: translateY(-1px);
}

/* Attendance Badge Base Styling */
.att-badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.7rem;
    color: #ffffff !important;
}
.att-h { background-color: #10b981 !important; }
.att-a { background-color: #ef4444 !important; }
.att-s { background-color: #f59e0b !important; }
.att-i { background-color: #0ea5e9 !important; }
.att-o { background-color: #8b5cf6 !important; }
.att-empty { color: #cbd5e1; font-weight: normal; }

/* ==========================================================================
   PRINT STYLES (Clean Proportional A4 Landscape Print for Attendance & Reports)
   ========================================================================== */
.print-only-header,
.print-signature-block {
    display: none;
}

@media print {
    /* Page Configuration: Full A4 Landscape */
    @page {
        size: A4 landscape;
        margin: 10mm 8mm 10mm 8mm;
    }

    html, body, .app-container, .main-content {
        display: block !important;
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Hide Navigation, Sidebars, Interactive Controls & App Footer */
    .sidebar,
    header.top-nav,
    .top-nav,
    .btn,
    button,
    form,
    .alert,
    .no-print,
    .currency-switcher,
    .sidebar-toggle,
    .btn-back,
    .panel-header,
    footer,
    .app-footer,
    .sidebar-overlay {
        display: none !important;
    }

    /* Reset Layout Dimensions */
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        display: block !important;
    }

    /* Official Print Header */
    .print-only-header {
        display: block !important;
        text-align: center;
        margin-bottom: 0.8rem !important;
        border-bottom: 2px solid #000000;
        padding-bottom: 0.4rem !important;
        width: 100% !important;
    }

    .print-only-header h2 {
        font-size: 1.5rem !important;
        font-weight: 800 !important;
        margin: 0 !important;
        color: #000000 !important;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .print-only-header p {
        font-size: 0.9rem !important;
        margin: 0.2rem 0 0 0 !important;
        color: #333333 !important;
    }

    /* Matrix Table Container for Print */
    .panel {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        display: block !important;
    }

    .panel-body {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        display: block !important;
    }

    .table-wrapper {
        overflow: visible !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }

    /* Matrix Table Formatting */
    table.grid-table {
        width: 100% !important;
        table-layout: auto !important;
        border-collapse: collapse !important;
        font-size: 8.5pt !important;
        margin-bottom: 0.75rem !important;
    }

    table.grid-table th,
    table.grid-table td {
        border: 1px solid #000000 !important;
        padding: 5px 3px !important;
        position: static !important;
        background: #ffffff !important;
        color: #000000 !important;
        text-shadow: none !important;
        text-align: center !important;
        vertical-align: middle !important;
    }

    /* Employee Name Column Protection */
    table.grid-table th.col-emp-name,
    table.grid-table td.col-emp-name {
        text-align: left !important;
        white-space: nowrap !important;
        min-width: 150px !important;
        width: 170px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    table.grid-table th {
        background-color: #f1f5f9 !important;
        font-weight: bold !important;
        font-size: 8pt !important;
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }

    table.grid-table th a {
        color: #000000 !important;
        text-decoration: none !important;
    }

    table.grid-table td strong {
        color: #000000 !important;
        font-size: 8.5pt !important;
    }

    /* Status Circle Badges for Print */
    .att-badge {
        display: inline-block !important;
        width: 16px !important;
        height: 16px !important;
        line-height: 16px !important;
        text-align: center !important;
        border-radius: 50% !important;
        font-size: 7pt !important;
        font-weight: bold !important;
        color: #ffffff !important;
        border: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .att-h { background-color: #10b981 !important; }
    .att-a { background-color: #ef4444 !important; }
    .att-s { background-color: #f59e0b !important; }
    .att-i { background-color: #0ea5e9 !important; }
    .att-o { background-color: #8b5cf6 !important; }
    .att-empty { color: #cbd5e1 !important; }

    /* Legend Footer */
    .panel-body > div:nth-child(2) {
        margin-top: 0.75rem !important;
        padding-top: 0.5rem !important;
        font-size: 8pt !important;
        border-top: 1px solid #cccccc !important;
    }

    /* Print Footer Signature Block */
    .print-signature-block {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        width: 100% !important;
        margin-top: 2.5rem !important;
        padding: 0 4rem !important;
        page-break-inside: avoid !important;
    }

    .print-signature-box {
        text-align: center !important;
        width: 200px !important;
        font-size: 9pt !important;
    }

    .print-signature-line {
        margin-top: 40px !important;
        border-top: 1px dashed #000000 !important;
        font-weight: bold !important;
        padding-top: 4px !important;
    }
}

/* ==========================================================================
   MODERN MINIMALIST DASHBOARD DESIGN SYSTEM
   ========================================================================== */
.dash-header-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.dash-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.dash-section-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.dash-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.dash-kpi-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.dash-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.dash-kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dash-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    background: #f8fafc;
    color: var(--text-secondary);
    border: 1px solid #f1f5f9;
}

.dash-kpi-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.dash-kpi-subtext {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

/* Subtle Accent Pill Indicators for Cards */
.dash-kpi-card.accent-success { border-top: 3px solid #10b981; }
.dash-kpi-card.accent-success .dash-kpi-icon { background: #ecfdf5; color: #10b981; border-color: #a7f3d0; }
.dash-kpi-card.accent-info { border-top: 3px solid #0ea5e9; }
.dash-kpi-card.accent-info .dash-kpi-icon { background: #f0f9ff; color: #0ea5e9; border-color: #bae6fd; }
.dash-kpi-card.accent-primary { border-top: 3px solid #6366f1; }
.dash-kpi-card.accent-primary .dash-kpi-icon { background: #eef2ff; color: #6366f1; border-color: #c7d2fe; }
.dash-kpi-card.accent-warning { border-top: 3px solid #f59e0b; }
.dash-kpi-card.accent-warning .dash-kpi-icon { background: #fffbeb; color: #f59e0b; border-color: #fde68a; }
.dash-kpi-card.accent-danger { border-top: 3px solid #f43f5e; }
.dash-kpi-card.accent-danger .dash-kpi-icon { background: #fff1f2; color: #f43f5e; border-color: #fecdd3; }

/* Dashboard Clean Table */
.dash-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.dash-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
}

.dash-table td {
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
}

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

/* Compact Executive Dashboard Helper Classes */
.dash-compact-kpi {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: all 0.15s ease;
}

.dash-compact-kpi:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.04);
}

.dash-compact-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.dash-compact-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -0.3px;
}

.dash-compact-sub {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.2rem;
    font-weight: 500;
}

.dash-compact-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    margin-bottom: 1rem;
    overflow: hidden;
}

.dash-compact-header {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.dash-compact-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dash-compact-body {
    padding: 0.85rem 1rem;
}




