/* ============================================
   Safwana Finance - Dark Admin Panel Theme
   PT. Safwana Marine International
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    /* Backgrounds */
    --bg-root: #f4f6f9;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card2: #f8fafc;
    --bg-input: #f8fafc;
    --bg-hover: #eff6ff;
    --bg-modal: #ffffff;
    --bg-topbar: rgba(244, 246, 249, 0.9);

    /* Accent */
    --accent: #1852e0; /* Brilliant Royal Blue */
    --accent-dim: rgba(24, 82, 224, 0.08);
    --accent-glow: rgba(24, 82, 224, 0.15);
    --accent-2: #1d4ed8; /* Royal Blue Hover */
    --accent-3: #1e3a8a;

    /* Text */
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --text-heading: #0f172a;

    /* Status */
    --green: #10b981;
    --yellow: #f59e0b;
    --red: #ef4444;
    --purple: #7b1fa2;
    --cyan: #06b6d4;

    /* Borders */
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 16px rgba(24, 82, 224, 0.08);

    /* Sizes */
    --sidebar-w: 240px;
    --topbar-h: 70px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;

    color-scheme: light;
}

:root[data-theme='dark'] {
    /* Backgrounds */
    --bg-root: #090d16;
    --bg-sidebar: #0e1320;
    --bg-card: #121827;
    --bg-card2: #161f30;
    --bg-input: #1e293b;
    --bg-hover: #203560;
    --bg-modal: #0b0f19;
    --bg-topbar: rgba(9, 13, 22, 0.95);

    /* Accent */
    --accent: #3b82f6;
    --accent-dim: rgba(59, 130, 246, 0.15);
    --accent-glow: rgba(59, 130, 246, 0.35);
    --accent-2: #60a5fa;
    --accent-3: #8b5cf6;

    /* Text */
    --text-primary: #cbd5e1;
    --text-muted: #64748b;
    --text-faint: #475569;
    --text-heading: #f8fafc;

    /* Status */
    --green: #10b981;
    --yellow: #f59e0b;
    --red: #ef4444;
    --purple: #a855f7;
    --cyan: #06b6d4;

    /* Borders */
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);

    /* Shadows */
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);

    color-scheme: dark;
}

/* Chart overrides for light mode */
:root[data-theme='light'] .chartjs-render-monitor {
    filter: brightness(0.4);
}

/* ---- Reset ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
}

body {
    background: var(--bg-root);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ---- App Shell Layout (Desktop: sidebar + main) ---- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ============== SIDEBAR ============== */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 200;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.sidebar-logo-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
    letter-spacing: -1px;
}

.sidebar-logo-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

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

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 4px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: rgba(59, 130, 246, 0.2);
}

.sidebar-item .material-icons-round {
    font-size: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    cursor: pointer;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    position: relative;
}

.sidebar-user-avatar::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    border: 2px solid var(--bg-sidebar);
    position: absolute;
    bottom: 0;
    right: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============== MAIN AREA ============== */
.main-area {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ============== TOP BAR ============== */
.top-bar {
    height: var(--topbar-h);
    background: var(--bg-topbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-date {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Search Box Top Bar Class */
.top-bar-search {
    flex: 1;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    margin-left: auto;
    margin-right: 16px;
}

.top-bar-search input {
    background: none;
    border: none;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
    width: 100%;
    padding: 0;
}

.top-bar-search input::placeholder {
    color: var(--text-muted);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

.top-bar-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    position: relative;
}

.top-bar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.top-bar-btn .material-icons-round {
    font-size: 18px;
}

.top-bar-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: 50%;
    border: 2px solid var(--bg-root);
}

.top-bar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s;
}

.top-bar-user:hover {
    background: var(--bg-hover);
}

.user-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

/* ============== APP CONTENT ============== */
.app-content {
    padding: 28px 28px 100px;
    flex: 1;
    min-width: 0;
}

.tab-pane {
    display: none;
}

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

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============== CARDS ============== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

/* ============== METRIC GRID ============== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 20px 16px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.metric-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: var(--shadow-glow);
}

.metric-card.full-width {
    grid-column: 1 / -1;
}

.metric-title {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.5px;
}

.metric-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 6px;
    display: inline-block;
}

.badge-green {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

.badge-yellow {
    background: rgba(245, 158, 11, 0.15);
    color: var(--yellow);
}

.badge-purple {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple);
}

.metric-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 16px 0 0 16px;
    display: none !important;
}

.border-real {
    background: #121e15 !important;
    color: #ffffff !important;
    border-color: #121e15 !important;
    box-shadow: 0 10px 20px rgba(18, 30, 21, 0.2) !important;
}

.border-real .metric-title {
    color: #a3b899 !important;
}

.border-real .metric-value {
    color: #ffffff !important;
}

.border-kas::before {
    background: var(--accent);
}

.border-real::before {
    background: var(--accent-3);
}

.border-in::before {
    background: var(--green);
}

.border-out::before {
    background: var(--red);
}

.border-hutang::before {
    background: var(--yellow);
}

.border-piutang::before {
    background: var(--cyan);
}

.spark-canvas {
    width: 100%;
    height: 32px;
    display: block;
    margin-top: 10px;
    opacity: 0.8;
}

/* ============== FORM ELEMENTS ============== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

select option {
    background: var(--bg-modal);
    color: var(--text-primary);
}

input:disabled,
select:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

input[type="date"] {
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.5);
    cursor: pointer;
}

/* ============== BUTTONS ============== */
.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-card2);
    color: var(--text-heading);
}

.btn-outline {
    background: transparent;
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-export {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-export:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.btn-calc {
    border: 1px solid var(--border-light);
    background: var(--bg-input);
    color: var(--text-heading);
    border-radius: var(--radius-sm);
    padding: 12px 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    outline: none;
}
.btn-calc:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}
.btn-calc:active {
    transform: scale(0.95);
}

.calendar-day-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 32px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50%;
    position: relative;
    color: var(--text-heading);
    transition: all 0.1s ease;
}
.calendar-day-cell:hover {
    background: var(--bg-hover);
}
.calendar-day-cell.other-month {
    color: var(--text-muted);
    opacity: 0.4;
}
.calendar-day-cell.today {
    border: 1.5px solid var(--accent);
    color: var(--accent);
    font-weight: 700;
}
.calendar-day-cell.selected {
    background: var(--accent) !important;
    color: white !important;
}
.calendar-day-cell.has-notice::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    background: var(--red);
    border-radius: 50%;
}

.w-100 {
    width: 100%;
}

.d-none {
    display: none !important;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 16px;
}

.mt-4 {
    margin-top: 24px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 16px;
}

.text-center {
    text-align: center;
}

.text-sm {
    font-size: 12px;
}

.text-primary {
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--green);
}

.text-danger {
    color: var(--red);
}

.text-warning {
    color: var(--yellow);
}

.text-cyan {
    color: var(--cyan);
}

.text-accent {
    color: var(--accent);
}

/* ============== MODAL ============== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-box {
    background: var(--bg-modal);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-heading);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

.modal-close .material-icons-round {
    font-size: 16px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-footer-trx {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.modal-footer-trx .left-actions {
    display: flex;
    gap: 12px;
}

.modal-footer-trx .right-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}


/* login card special (Web3 Glassmorphism Style) */
.login-page-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #f8fafc, #e2e8f0);
    transition: background 0.3s ease;
}
:root[data-theme='dark'] .login-page-body {
    background: radial-gradient(circle at 50% 50%, #0f172a, #020617);
}

.login-page-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(24, 82, 224, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(24, 82, 224, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
}
:root[data-theme='dark'] .login-page-body::before {
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.02) 1px, transparent 1px);
}

.login-page-body .blob-1 {
    width: 500px;
    height: 500px;
    background: rgba(24, 82, 224, 0.08) !important;
    filter: blur(120px);
    position: absolute;
    top: -100px;
    left: -100px;
    animation: float-blob-1 12s ease-in-out infinite alternate;
    z-index: 1;
    display: block !important;
    opacity: 1 !important;
}
:root[data-theme='dark'] .login-page-body .blob-1 {
    background: rgba(59, 130, 246, 0.05) !important;
}

.login-page-body .blob-2 {
    width: 450px;
    height: 450px;
    background: rgba(168, 85, 247, 0.06) !important;
    filter: blur(120px);
    position: absolute;
    bottom: -100px;
    right: -100px;
    animation: float-blob-2 15s ease-in-out infinite alternate;
    z-index: 1;
    display: block !important;
    opacity: 1 !important;
}
:root[data-theme='dark'] .login-page-body .blob-2 {
    background: rgba(168, 85, 247, 0.04) !important;
}

@keyframes float-blob-1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 30px) scale(1.08); }
}
@keyframes float-blob-2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-40px, -40px) scale(0.92); }
}

.theme-toggle-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 100;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(24, 82, 224, 0.1);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
:root[data-theme='dark'] .theme-toggle-btn {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(18, 24, 39, 0.6);
    color: var(--text-primary);
}
.theme-toggle-btn:hover {
    transform: scale(1.05);
    background: var(--bg-hover);
    color: var(--accent);
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    z-index: 10;
    padding: 0 16px;
}

.login-card {
    width: 100%;
    padding: 40px;
    background: rgba(255, 255, 255, 0.65) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(24, 82, 224, 0.08) !important;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
    transition: all 0.3s ease;
}
:root[data-theme='dark'] .login-card {
    background: rgba(18, 24, 39, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}
.error-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--red);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

/* ============== LIST / TABLE ITEMS ============== */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.list-item:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.list-item:last-child {
    margin-bottom: 0;
}

.list-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 2px;
}

.list-item-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.list-item-amount {
    font-size: 15px;
    font-weight: 700;
}

.icon-bg {
    width: 40px;
    height: 40px;
    border-radius: 50% !important;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-bg .material-icons-round {
    font-size: 20px;
}

.recent-list {
    display: flex;
    flex-direction: column;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 10px;
    font-size: 13px;
}

/* ============== SEARCH BOX ============== */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    margin-bottom: 16px;
}

.search-box input,
.search-box select {
    border: none;
    background: transparent;
    padding: 11px 0;
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    box-shadow: none;
}

/* ============== DRAG AND DROP KATEGORI ============== */
.draggable-kat {
    cursor: grab;
    user-select: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* --- Lifebuoy Loader Animation --- */
.lifebuoy-loader {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    animation: float-lifebuoy 3s ease-in-out infinite;
}
.lifebuoy-spin {
    transform-origin: center;
    animation: spin-lifebuoy 2.5s linear infinite;
}
@keyframes float-lifebuoy {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}
@keyframes spin-lifebuoy {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.draggable-kat:active {
    cursor: grabbing;
}

.draggable-kat.dragging {
    opacity: 0.4;
    transform: scale(0.98);
    box-shadow: var(--shadow-lg);
    border: 1px dashed var(--accent) !important;
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    padding: 4px;
    margin-right: 8px;
}

.drag-handle:active {
    cursor: grabbing;
    color: var(--accent);
}

.kategori-list {
    min-height: 50px;
    padding-bottom: 10px;
}

/* ============== REPORT SUMMARY ============== */
.report-summary {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 0;
}

.rep-box {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
}

.rep-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rep-value {
    font-size: 17px;
    font-weight: 700;
}

/* ============== AVATAR ============== */
.avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent-dim), rgba(99, 102, 241, 0.1));
    border: 2px solid rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============== UPLOAD AREA ============== */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-input);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: var(--accent);
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    padding: 0;
    background: none;
    border: none;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    pointer-events: none;
}

.btn-remove-photo {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

/* ============== DETAIL ROWS ============== */
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
    font-size: 13px;
    flex: 1;
}

.detail-val {
    color: var(--text-heading);
    font-weight: 500;
    font-size: 14px;
    text-align: right;
    flex: 2;
    word-break: break-word;
}

/* ============== WATCHLIST ============== */
.watch-item {
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
}

/* ============== MISC ============== */
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.theme-toggle {
    display: none;
}

.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.04;
    pointer-events: none;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    top: -200px;
    left: 50px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-3);
    bottom: -100px;
    right: -100px;
}

/* ============== BOTTOM NAV ============== */
.bottom-nav {
    display: none;
}

/* ============== MOBILE HEADER ============== */
.app-header {
    display: none;
}

/* ============================================================
   DESKTOP: >= 768px
   ============================================================ */
@media (min-width: 768px) {
    .sidebar {
        display: flex;
    }

    .main-area {
        margin-left: var(--sidebar-w);
    }

    .top-bar,
    .desktop-only-header {
        display: flex !important;
    }

    .app-header {
        display: none;
    }

    .bottom-nav {
        display: none;
    }

    .app-content {
        padding: 28px 28px 40px;
    }

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

    .metric-card.full-width {
        grid-column: span 3;
    }
}

/* ============================================================
   MOBILE: < 768px & PERBAIKAN SPACING
   ============================================================ */
@media (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-area {
        margin-left: 0;
    }

    .top-bar,
    .desktop-only-header {
        display: none !important;
    }

    /* Mobile header shown instead */
    .app-header {
        display: flex;
        background: var(--bg-modal);
        border-bottom: 1px solid var(--border);
        padding: 14px 16px;
        justify-content: space-between;
        align-items: center;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .logo-area .app-title {
        font-size: 18px;
        font-weight: 700;
        background: linear-gradient(120deg, var(--accent), var(--cyan));
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .logo-area .app-subtitle {
        font-size: 10px;
        color: var(--text-muted);
        letter-spacing: 1px;
        text-transform: uppercase;
    }

    .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .header-btn {
        width: 36px;
        height: 36px;
        border-radius: var(--radius-sm);
        background: var(--bg-card);
        border: 1px solid var(--border);
        color: var(--text-muted);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header-btn .material-icons-round {
        font-size: 20px;
    }

    .app-content {
        padding: 16px 16px 120px !important;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 16px;
    }

    .metric-card.full-width {
        grid-column: 1 / -1;
    }

    .metric-value {
        font-size: 18px;
    }

    #tab-laporan .card>div[style*="display:flex"] {
        flex-direction: column;
        align-items: stretch !important;
    }

    #tab-laporan .search-box {
        width: 100%;
    }

    .form-layout>div[style*="display:grid"] {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .bottom-nav {
        display: flex;
        position: fixed !important;
        bottom: 0 !important;
        left: 0;
        right: 0;
        background: var(--bg-modal);
        border-top: 1px solid var(--border);
        padding: 12px 8px calc(16px + env(safe-area-inset-bottom));
        justify-content: space-around;
        z-index: 9999 !important;
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 10px;
        font-weight: 500;
        padding: 4px 12px;
        border-radius: var(--radius-sm);
        transition: all 0.2s;
    }

    .nav-item .material-icons-round {
        font-size: 22px;
    }

    .nav-item.active {
        color: var(--accent);
    }

    .nav-item.active .material-icons-round {
        filter: drop-shadow(0 0 6px var(--accent-glow));
    }

    .modal-box {
        padding: 20px;
        margin: 16px;
        width: calc(100% - 32px);
    }

    .login-card {
        padding: 28px 20px;
    }
}

/* ============== PRINT ============== */
@media print {
    .sidebar,
    .top-bar,
    .app-header,
    .bottom-nav,
    .modal-overlay,
    .bg-blob,
    .btn-export,
    .btn-primary,
    .btn-outline,
    #group-pajak {
        display: none !important;
    }

    .main-area {
        margin-left: 0;
    }

    .app-content {
        padding: 0;
    }

    .tab-pane {
        display: block !important;
    }

    #tab-dashboard,
    #tab-transactions,
    #tab-contacts,
    #tab-profile {
        display: none !important;
    }

    #tab-laporan {
        display: block !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .card {
        background: white !important;
        border: 1px solid #ddd !important;
        color: black !important;
    }

    .list-item {
        background: white !important;
        border: 1px solid #eee !important;
        color: black !important;
    }

    .text-success {
        color: #059669 !important;
    }

    .text-danger {
        color: #dc2626 !important;
    }

    .text-warning {
        color: #d97706 !important;
    }

    .text-accent {
        color: #1d4ed8 !important;
    }

    #chart-container {
        display: block !important;
        height: 280px !important;
    }
}

/* ============================================================
   PREMIUM CUSTOM STYLES & OVERRIDES (NEOPAY STYLE)
   ============================================================ */

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(24, 82, 224, 0.2);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(24, 82, 224, 0.4);
}

/* Sidebar Grouping Headers */
.sidebar-category-header {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 18px 14px 6px;
    user-select: none;
}

/* Sidebar Item Style Overrides */
.sidebar-item {
    border-left: 4px solid transparent;
    border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
    margin-right: 12px;
}
.sidebar-item.active {
    background: var(--accent-dim) !important;
    color: var(--accent) !important;
    border-color: transparent !important;
    border-left: 4px solid var(--accent) !important;
}

/* Glassmorphic Overlays */
.modal-overlay {
    background: rgba(15, 23, 42, 0.5) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* Dashboard Greeting Banner Widget */
.greeting-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent !important;
    border: none !important;
    padding: 0 0 16px 0 !important;
    margin-bottom: 8px;
}
.greeting-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(24, 82, 224, 0.15);
    font-size: 14px;
}

/* Dashboard Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: var(--bg-card2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    gap: 6px;
    color: var(--text-primary);
    text-decoration: none;
}
.quick-action-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--border);
}
.quick-action-btn .material-icons-round,
.quick-action-btn .sf-icon {
    font-size: 20px;
    color: var(--accent);
}
.quick-action-label {
    font-size: 10px;
    font-weight: 600;
}

/* AI Financial Insights Card */
.ai-insight-card {
    background: #102a6b !important;
    color: #ffffff !important;
    border-color: #102a6b !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(16, 42, 107, 0.15) !important;
}
.ai-insight-card .section-title {
    color: #93c5fd !important;
}
.ai-insight-card .btn-primary {
    background: #1852e0 !important;
    box-shadow: none !important;
}
.ai-insight-card .btn-primary:hover {
    background: #1d4ed8 !important;
}
.ai-insight-bulb {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 72px !important;
    opacity: 0.05;
    color: #ffffff;
    pointer-events: none;
}

/* Floating Responsive Bottom Nav for Mobile */
.bottom-nav {
    margin: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
:root[data-theme='dark'] .bottom-nav {
    background: rgba(11, 15, 25, 0.85) !important;
}
.bottom-nav .nav-item {
    border-radius: 14px;
}
.bottom-nav .nav-item.active {
    color: var(--accent) !important;
    background: var(--accent-dim);
}

/* Smooth Input Focus transition */
input, select, textarea {
    transition: all 0.2s ease-in-out;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-dim) !important;
}

/* Dashboard main column layouts */
@media (max-width: 991px) {
    .dashboard-main-layout {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

/* Horizontal Responsive Filter Panel */
.filter-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
    width: 100%;
}

@media (max-width: 767px) {
    .filter-panel {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
}

/* Global Text Ellipsis utility */
.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   NEW RESPONSIVE LAYOUT CLASSES
   ============================================================ */

.dashboard-main-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

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

.metrics-row-grid,
.banking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.chart-legend-flex {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.chart-wrap {
    flex: 2.3;
    min-width: 280px;
    height: 260px;
    position: relative;
    width: 100%;
}

.report-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

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

.card-actions-row {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.export-buttons-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.estimasi-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-input);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    gap: 12px;
    min-width: 0;
}

/* Responsive Media Query Adjustments */

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

@media (max-width: 767px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .report-actions-row {
        flex-direction: column;
        align-items: stretch;
    }
    .report-actions-row .search-box {
        max-width: none !important;
        width: 100%;
    }
    .card {
        padding: 16px !important;
    }
    .metrics-row-grid,
    .banking-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .card-header-row {
        flex-direction: column;
        align-items: stretch;
    }
    .card-header-row button {
        width: 100%;
        justify-content: center;
    }
    .card-actions-row {
        justify-content: stretch;
    }
    .card-actions-row button {
        width: 100%;
        justify-content: center;
    }
    .modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .modal-footer button {
        width: 100%;
        justify-content: center;
    }
    .modal-footer-trx {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .modal-footer-trx .left-actions,
    .modal-footer-trx .right-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        width: 100%;
        gap: 12px;
    }
    .modal-footer-trx button {
        width: 100%;
        justify-content: center;
    }
    .export-buttons-group {
        width: 100%;
        justify-content: stretch;
    }
    .export-buttons-group .btn-export {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .chart-wrap {
        min-width: 100%;
        height: 200px;
    }
    .report-summary {
        flex-direction: column;
    }
    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .list-item-left {
        width: 100%;
        padding-right: 0 !important;
    }
    .list-item-amount {
        align-self: flex-end;
    }
    .estimasi-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .estimasi-list-item div:last-child {
        align-self: flex-end;
    }
}

/* ============================================================
   UTILITY CENTER BUTTONS
   ============================================================ */
.utility-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
    font-family: inherit;
}
.utility-btn span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s ease;
}
.utility-btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(24, 82, 224, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    transition: all 0.25s ease;
}
.utility-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(24, 82, 224, 0.18);
}
.utility-btn:hover .utility-btn-icon {
    background: rgba(24, 82, 224, 0.16);
    transform: scale(1.1);
}
.utility-btn:hover span {
    color: var(--accent);
}
.utility-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Contact Card Actions styling */
.contact-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.contact-action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    outline: none;
}

.contact-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.contact-action-btn .material-icons-round {
    font-size: 16px !important;
}

.contact-action-btn.btn-cicil {
    color: var(--purple);
    background: rgba(123, 31, 162, 0.08);
    border-color: rgba(123, 31, 162, 0.2);
}
.contact-action-btn.btn-cicil:hover {
    background: rgba(123, 31, 162, 0.15);
    border-color: rgba(123, 31, 162, 0.35);
}

.contact-action-btn.btn-edit {
    color: var(--cyan);
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.2);
}
.contact-action-btn.btn-edit:hover {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.35);
}

.contact-action-btn.btn-delete {
    color: var(--red);
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}
.contact-action-btn.btn-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
}



