/* Custom Design System & Variable Declarations */
:root {
    --bg-primary: #080d19;
    --bg-sidebar: #0c1322;
    --bg-card: #0f172a;
    --bg-input: #131b2e;
    --border-color: #222f46;
    --border-hover: #334155;
    
    --accent-blue: #2563eb;
    --accent-blue-hover: #3b82f6;
    --accent-green: #10b981;
    --accent-green-hover: #059669;
    --accent-red: #ef4444;
    --accent-red-hover: #dc2626;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-active: #3b82f6;
    
    --font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --radius-lg: 12px;
    --radius-md: 8px;
}

/* Reset Defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Webkit Scrollbar overrides */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Layout Architecture */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 16px;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 0 12px 24px 12px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.logo-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-top: -2px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    margin-top: 16px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

.menu-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
    flex-shrink: 0;
}

.menu-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.menu-item.active {
    color: var(--text-primary);
    background-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.sign-out-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--accent-red);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.sign-out-btn:hover {
    background-color: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.sign-out-icon {
    width: 18px;
    height: 18px;
}

.version-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--bg-primary);
    position: relative;
}

/* Top Clock Header */
.top-header {
    background-color: rgba(12, 19, 34, 0.4);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.time-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-active);
    font-weight: 600;
    font-size: 0.875rem;
    background-color: rgba(37, 99, 235, 0.1);
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.clock-icon {
    width: 16px;
    height: 16px;
}

/* Dashboard Panel */
.dashboard-panel {
    padding: 32px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Bank Navigation Tabs */
.bank-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    padding-bottom: 1px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 4px 16px 4px;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

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

.tab-btn.active {
    color: var(--text-active);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-blue);
    border-radius: 2px;
}

/* Panel Configuration Grid */
.panel-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 28px;
    align-items: start;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-premium);
}

/* Config Form */
.form-card {
    display: flex;
    flex-direction: column;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Password Visibility Toggler */
.password-group .password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-group input {
    padding-right: 48px !important;
}

.toggle-password-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.toggle-password-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.eye-icon {
    width: 18px;
    height: 18px;
}

/* Status Switch */
.status-group {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 10px;
    margin-bottom: 24px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: .4s;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: var(--accent-green);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Form Buttons */
.form-actions {
    display: flex;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    min-height: 46px;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: white;
    flex-grow: 1.2;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--accent-blue-hover);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-success {
    background-color: var(--accent-green);
    color: white;
    flex-grow: 1;
}

.btn-success:hover:not(:disabled) {
    background-color: var(--accent-green-hover);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background-color: #334155;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #475569;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner Loading */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

.spinner.hidden {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Guide Card Styling */
.guide-card {
    background-color: #0c1527;
    border: 1px solid rgba(37, 99, 235, 0.15);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.guide-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-icon {
    width: 24px;
    height: 24px;
    color: var(--text-active);
    flex-shrink: 0;
}

.guide-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.guide-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

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

.guide-content ol {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-content ol li {
    font-weight: 500;
}

.guide-note {
    border-left: 3px solid var(--accent-blue);
    padding-left: 12px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Footer Section inside Panel */
.content-footer {
    margin-top: auto;
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Weather Widget */
.weather-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.825rem;
    font-weight: 500;
}

.weather-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.weather-widget .temp {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Help Bubble & Support Chat */
.support-chat {
    display: flex;
    align-items: center;
    gap: 12px;
}

.help-bubble {
    background-color: white;
    color: #1e293b;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: float 3s ease-in-out infinite;
}

.help-bubble::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background-color: white;
}

.chat-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--accent-green);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    transition: var(--transition-smooth);
}

.chat-btn:hover {
    background-color: var(--accent-green-hover);
    transform: scale(1.08);
}

.whatsapp-icon {
    width: 24px;
    height: 24px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Modal Overlay Window */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(8, 13, 25, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 420px;
    max-width: 90%;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    right: 16px;
    top: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.modal-close-btn svg {
    width: 20px;
    height: 20px;
}

/* QRIS Stylized Poster Design */
.qris-display-container {
    display: flex;
    justify-content: center;
}

.qris-poster {
    background-color: white;
    color: #1a1a1a;
    width: 100%;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qris-poster-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e11d48; /* Crimson red accent */
    padding-bottom: 6px;
}

.qris-logo-main {
    font-size: 1.8rem;
    font-weight: 900;
    color: #1d4ed8; /* Blue */
    font-family: sans-serif;
    font-style: italic;
    letter-spacing: -1px;
}

.qris-gpn-logo {
    background-color: #ef4444;
    color: white;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.qris-merchant-details {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qris-merchant-details h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.qris-merchant-details .nm-id {
    font-size: 0.75rem;
    color: #4b5563;
    font-weight: 600;
    font-family: monospace;
}

.qris-merchant-details .tid-display {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 500;
    font-family: monospace;
}

.qris-qr-wrapper {
    background-color: #f3f4f6;
    padding: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
}

#qris-qr-code {
    width: 180px;
    height: 180px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.qris-poster-footer {
    border-top: 1px dashed #d1d5db;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.qris-poster-footer .ps-txt {
    font-size: 0.55rem;
    color: #6b7280;
    text-align: center;
    font-weight: 600;
}

.modal-bank-logo {
    font-size: 0.75rem;
    font-weight: 800;
    color: #2563eb;
    text-transform: uppercase;
    background-color: #eff6ff;
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
}

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

.modal-actions button {
    flex: 1;
}

/* Toast System */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.toast {
    min-width: 320px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translateX(120%);
    animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    position: relative;
    overflow: hidden;
}

.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--toast-color, var(--accent-blue));
    animation: toast-timer 3s linear forwards;
}

.toast-icon {
    width: 20px;
    height: 20px;
    color: var(--toast-color, var(--accent-blue));
    flex-shrink: 0;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-desc {
    font-size: 0.775rem;
    color: var(--text-secondary);
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.toast-close:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

@keyframes toast-in {
    to { transform: translateX(0); }
}

@keyframes toast-timer {
    from { width: 100%; }
    to { width: 0%; }
}

.toast.toast-success { --toast-color: var(--accent-green); }
.toast.toast-error { --toast-color: var(--accent-red); }
.toast.toast-info { --toast-color: var(--accent-blue); }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        width: 80px;
        padding: 24px 8px;
    }
    .logo-text, .logo-subtext, .menu-item span, .sign-out-btn span, .version-tag {
        display: none;
    }
    .menu-item {
        justify-content: center;
        padding: 12px 0;
    }
    .sign-out-btn {
        border: none;
        padding: 12px 0;
    }
    .top-header {
        padding: 16px 20px;
    }
    .dashboard-panel {
        padding: 20px;
    }
}
