/* ============================================================
   FuzzyBank - Professional Banking CSS
   ============================================================ */

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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    background-color: #f4f6f9;
}

a {
    color: #1a5632;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Utility --- */
.text-green { color: #1a7a3a; }
.text-red   { color: #c0392b; }
.text-muted { color: #777; }

/* ============================================================
   Header / Top Navigation Bar
   ============================================================ */
.header {
    background-color: #1a2744;
    color: #fff;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    text-decoration: none;
}

.header-brand:hover {
    text-decoration: none;
    color: #d4edda;
}

.header-brand .brand-icon {
    background-color: #1a5632;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-user {
    font-size: 14px;
    color: #cbd5e0;
}

.header-user strong {
    color: #fff;
}

/* ============================================================
   Sidebar Navigation
   ============================================================ */
.layout {
    display: flex;
    min-height: 100vh;
    padding-top: 56px;
}

.sidebar {
    width: 220px;
    min-width: 220px;
    background-color: #fff;
    border-right: 1px solid #e2e8f0;
    padding: 20px 0;
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 900;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 2px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 24px;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
}

.sidebar-nav a:hover {
    background-color: #f7fafc;
    color: #1a5632;
    text-decoration: none;
}

.sidebar-nav a.active {
    background-color: #f0fdf4;
    color: #1a5632;
    border-left-color: #1a5632;
    font-weight: 600;
}

.sidebar-nav .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-section-label {
    padding: 20px 24px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #a0aec0;
}

/* ============================================================
   Main Content Area
   ============================================================ */
.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 28px 32px;
    min-height: calc(100vh - 56px);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a2744;
    margin-bottom: 24px;
}

.page-subtitle {
    font-size: 15px;
    color: #666;
    margin-bottom: 24px;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    font-size: 16px;
    font-weight: 600;
    color: #1a2744;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.summary-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    padding: 24px;
    border-left: 4px solid #1a5632;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.summary-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1a2744;
    margin-bottom: 6px;
}

.summary-card p {
    font-size: 13px;
    color: #718096;
    margin-bottom: 14px;
}

.summary-card a {
    font-size: 13px;
    font-weight: 600;
    color: #1a5632;
}

.summary-card.card-accounts   { border-left-color: #1a5632; }
.summary-card.card-transactions { border-left-color: #2b6cb0; }
.summary-card.card-contact    { border-left-color: #805ad5; }

/* ============================================================
   Tables
   ============================================================ */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

table thead {
    background-color: #1a2744;
    color: #fff;
}

table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

table tbody tr {
    border-bottom: 1px solid #edf2f7;
    transition: background-color 0.1s ease;
}

table tbody tr:hover {
    background-color: #f7fafc;
}

table tbody td {
    padding: 12px 16px;
    font-size: 14px;
    color: #4a5568;
}

table tbody td.amount-credit {
    color: #1a7a3a;
    font-weight: 600;
}

table tbody td.amount-debit {
    color: #c0392b;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    background-color: #f0fdf4;
    color: #166534;
}

.category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background-color: #edf2f7;
    color: #4a5568;
}

/* ============================================================
   Contact Info Details
   ============================================================ */
.contact-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px 20px;
    align-items: baseline;
}

.contact-label {
    font-size: 13px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.contact-value {
    font-size: 15px;
    color: #2d3748;
}

/* ============================================================
   Authorities / Debug Section
   ============================================================ */
.authorities-section {
    margin-top: 32px;
}

.authority-tag {
    display: inline-block;
    padding: 4px 12px;
    margin: 3px 4px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background-color: #edf2f7;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.15s ease;
    line-height: 1.5;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: #1a5632;
    color: #fff;
}

.btn-primary:hover {
    background-color: #145228;
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,86,50,0.3);
}

.btn-secondary {
    background-color: #718096;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5a6a7e;
    color: #fff;
}

.btn-danger {
    background-color: #c0392b;
    color: #fff;
}

.btn-danger:hover {
    background-color: #a5311f;
    color: #fff;
}

.btn-outline {
    background-color: transparent;
    color: #1a5632;
    border: 2px solid #1a5632;
}

.btn-outline:hover {
    background-color: #1a5632;
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 36px;
    font-size: 16px;
}

/* Logout button styling */
.logout-form {
    display: inline;
}

.logout-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #cbd5e0;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

/* ============================================================
   Landing / Hero Page
   ============================================================ */
.landing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.landing-header {
    background-color: #1a2744;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

.landing-header .brand:hover {
    text-decoration: none;
}

.landing-header .brand .brand-icon {
    background-color: #1a5632;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
}

.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f4f6f9 0%, #e8ecf1 100%);
}

.hero-content {
    max-width: 640px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    color: #1a2744;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero .tagline {
    font-size: 18px;
    color: #5a6a7e;
    margin-bottom: 36px;
    line-height: 1.5;
}

.hero .btn {
    margin-bottom: 16px;
}

.sso-note {
    font-size: 13px;
    color: #718096;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 32px;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    max-width: 700px;
    margin: 0 auto;
}

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

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: #f0fdf4;
    color: #1a5632;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 22px;
    font-weight: 700;
}

.feature-item h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1a2744;
    margin-bottom: 4px;
}

.feature-item p {
    font-size: 13px;
    color: #718096;
}

.landing-footer {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: #a0aec0;
    border-top: 1px solid #e2e8f0;
    background-color: #fff;
}

/* ============================================================
   Test Credentials Leaflet
   ============================================================ */
.credentials-section {
    background-color: #f4f6f9;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}

.credentials-leaflet {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    border-top: 4px solid #1a5632;
    padding: 32px 36px;
    width: 100%;
    max-width: 820px;
}

.credentials-header {
    text-align: center;
    margin-bottom: 28px;
}

.credentials-badge {
    display: inline-block;
    background-color: #fef9c3;
    color: #854d0e;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #fde68a;
    margin-bottom: 10px;
}

.credentials-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a2744;
    margin-bottom: 6px;
}

.credentials-header p {
    font-size: 14px;
    color: #718096;
}

.credentials-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.credentials-group h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a0aec0;
    margin-bottom: 12px;
}

.credentials-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #a0aec0;
    font-style: italic;
}

.credentials-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    box-shadow: none;
}

.credentials-table thead {
    background-color: #f7fafc;
}

.credentials-table thead th {
    padding: 8px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #718096;
    border-bottom: 1px solid #e2e8f0;
}

.credentials-table tbody tr {
    border-bottom: 1px solid #f0f4f8;
}

.credentials-table tbody tr:last-child {
    border-bottom: none;
}

.credentials-table tbody td {
    padding: 9px 12px;
    color: #4a5568;
    font-size: 13px;
}

.credentials-table code {
    background-color: #f0fdf4;
    color: #166534;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12px;
    border: 1px solid #bbf7d0;
}

.credentials-table em {
    color: #a0aec0;
    font-style: normal;
    font-size: 12px;
}

@media (max-width: 768px) {
    .credentials-grid {
        grid-template-columns: 1fr;
    }
    .credentials-leaflet {
        padding: 24px 18px;
    }
}

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f4f6f9 0%, #e8ecf1 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.login-brand .brand-icon {
    background-color: #1a5632;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
}

.login-brand span {
    font-size: 22px;
    font-weight: 700;
    color: #1a2744;
}

.login-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a2744;
    margin-bottom: 8px;
}

.login-card .login-info {
    font-size: 14px;
    color: #718096;
    margin-bottom: 28px;
    line-height: 1.5;
}

.login-card .btn {
    width: 100%;
    margin-bottom: 20px;
}

.login-card .back-link {
    font-size: 13px;
    color: #718096;
}

.login-card .back-link a {
    color: #1a5632;
    font-weight: 500;
}

/* ============================================================
   Access Denied Page
   ============================================================ */
.access-denied-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f4f6f9 0%, #e8ecf1 100%);
    padding: 20px;
}

.access-denied-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    padding: 40px 36px;
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.access-denied-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.access-denied-card h2 {
    font-size: 24px;
    font-weight: 700;
    color: #c0392b;
    margin-bottom: 12px;
}

.access-denied-card p {
    font-size: 15px;
    color: #4a5568;
    margin-bottom: 12px;
    line-height: 1.6;
}

.access-denied-card .detail-text {
    font-size: 13px;
    color: #a0aec0;
    margin-bottom: 28px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 20px 16px;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hero h1 {
        font-size: 30px;
    }

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

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

/* ============================================================
   Login Form Styles
   ============================================================ */
.login-form {
    margin-top: 24px;
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #1a5632;
    box-shadow: 0 0 0 3px rgba(26, 86, 50, 0.15);
}

.form-group input::placeholder {
    color: #a0aec0;
}

/* ============================================================
   Alert Styles
   ============================================================ */
.alert {
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
}

/* ============================================================
   Loading Indicator
   ============================================================ */
.loading-indicator {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
    font-size: 15px;
}

.loading-indicator::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #1a5632;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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