/* -----------------------------
   GLOBAL RESET / BASE
------------------------------ */

html, body {
  height: 100%;
}

/* =====================================================
   GLOBAL
===================================================== */
body {
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.25s ease, color 0.25s ease;
}


/* AUTH LAYOUT */

.auth-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 40px;
}

/* Header */
.auth-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
}

.auth-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
}

/* Card */
.auth-card {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    background-color: #ffffff !important;
    color: #111827;
    border-radius: 14px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    animation: fadeUp 0.5s ease-out;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

    .auth-card .form-control {
        background-color: #ffffff;
        color: #111827;
        border: 1px solid #d1d5db;
    }

        .auth-card .form-control::placeholder {
            color: #9ca3af;
        }

        .auth-card .form-control:focus {
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
        }

    .auth-card .btn-primary {
        background-color: #6366f1;
        border-color: #6366f1;
        font-weight: 500;
        padding: 10px 16px;
    }

        .auth-card .btn-primary:hover {
            background-color: #4f46e5;
            border-color: #4f46e5;
        }


    .auth-card h2 {
        font-weight: 600;
        margin-bottom: 24px;
    }

    .auth-card .form-label {
        font-size: 14px;
        font-weight: 500;
        color: #374151;
    }

/* Animated background */
.bg-animated {
    position: absolute;
    inset: -30%;
    background: linear-gradient( 120deg, #dbeafe, #e0f2fe, #ede9fe );
    background-size: 200% 200%;
    animation: gradientMove 30s ease infinite;
    filter: blur(80px);
    opacity: 1;
    z-index: 0;
}


@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* =====================================================
   CARDS
===================================================== */
.card,
.card-app {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

/* =====================================================
   TEXT
===================================================== */
.text-secondary {
  color: var(--muted) !important;
}

/* =====================================================
   FORMS
===================================================== */
.form-control,
.form-select {
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* =====================================================
   BUTTONS
===================================================== */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-outline-secondary {
  color: var(--text);
  border-color: var(--border);
}

.btn-outline-secondary:hover {
  background-color: rgba(99,102,241,0.08);
  border-color: var(--primary);
}

/* =====================================================
   NAVBAR
===================================================== */
.navbar {
    background-color: var(--topbar-bg);
    border-bottom: 1px solid var(--border);
}

.navbar-brand {
    color: var(--text) !important;
    font-weight: 600;
}

.navbar .btn-outline-secondary {
    border-color: var(--border);
    color: var(--text-muted);
}

    .navbar .btn-outline-secondary:hover {
        background-color: var(--card-muted);
        color: var(--text);
    }

/* =====================================================
   TABLES
===================================================== */
.table {
  color: var(--text);
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.table td,
.table th {
  border-color: var(--border);
}

/* =====================================================
   ALERTS
===================================================== */
.alert {
  background-color: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
}

/* App shell */
.app-shell {
    display: flex;
    min-height: calc(100vh - 56px); /* below top bar */
}

/* Sidebar base */
.sidebar {
    width: 240px;
    min-width: 240px;
    background-color: #f8fafc; /* lighter than content */
    border-right: 1px solid #e5e7eb;
    transition: width 0.25s ease;
    overflow-x: hidden;
}

    /* Collapsed */
    .sidebar.collapsed {
        width: 64px;
        min-width: 64px;
    }

/* Nav list */
.sidebar-nav {
    padding: 8px 0;
}

/* Nav link */
.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin: 4px 8px;
    border-radius: 10px;
    color: #475569; /* slate-600 */
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
}

    /* Hover */
    .sidebar .nav-link:hover {
        background-color: #f1f5f9;
        color: #1e293b;
    }


    .sidebar .nav-link.active {
        background-color: #eef2ff; /* indigo-50 */
        color: #1e3a8a; /* indigo-900 */
        position: relative;
    }

        .sidebar .nav-link.active::before {
            content: "";
            position: absolute;
            left: 0;
            top: 8px;
            bottom: 8px;
            width: 3px;
            background-color: #6366f1;
            border-radius: 2px;
        }
/* Icon */
.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    color: #64748b; /* slate-500 */
}

.sidebar .nav-link.active .nav-icon {
    color: #6366f1;
}

.sidebar-nav {
    padding-top: 12px;
}

.sidebar .nav-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
}

/* Text */
.nav-text {
    flex: 1;
    transition: opacity 0.15s ease;
}

/* Badge */
.nav-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 500;
}

    .nav-badge.success {
        background-color: #dcfce7;
        color: #166534;
    }

    .nav-badge.warning {
        background-color: #fef3c7;
        color: #92400e;
    }

    .nav-badge.danger {
        background-color: #fee2e2;
        color: #991b1b;
    }

.app-navbar {
    height: 56px;
    background-color: #f8fafc; /* slate-50 */
    border-bottom: 1px solid #e5e7eb;
}

/* Divider */
.nav-divider {
    height: 1px;
    background-color: var(--border);
    margin: 10px 16px;
}

/* COLLAPSED STATE */
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-badge {
    opacity: 0;
    pointer-events: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 10px;
}



/* Main content */
.content-area {
    flex: 1;
    background-color: var(--bg);
    overflow-x: auto;
}



/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -240px;
        top: 56px;
        height: calc(100vh - 56px);
        z-index: 1000;
    }

        .sidebar.collapsed {
            left: 0;
            width: 240px;
        }
}


/* Section icon */
.section-icon {
    font-size: 18px;
}

/* Payment state container */
.payment-state {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

    /* Icons */
    .payment-state .state-icon {
        font-size: 22px;
        line-height: 1;
        margin-top: 2px;
    }

    /* Content */
    .payment-state .state-content {
        flex: 1;
    }

    /* Warning state */
    .payment-state.warning {
        background-color: rgba(245, 158, 11, 0.08); /* amber */
        border-color: rgba(245, 158, 11, 0.3);
    }

    /* Success state */
    .payment-state.success {
        background-color: rgba(34, 197, 94, 0.08); /* green */
        border-color: rgba(34, 197, 94, 0.3);
    }

/* Detail rows */
.state-detail {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}

/* =====================================================
   PAGE CONTENT SURFACE (MAIN AREA)
===================================================== */

.page-content {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
}

/* =====================================================
   AUTH BRAND (LOGIN / REGISTER)
===================================================== */

.auth-brand {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827; /* slate-900 */
    text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}

@media (max-width: 640px) {
    .auth-brand {
        font-size: 18px;
    }
}

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    z-index: 1;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

.auth-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.auth-submit {
    margin-top: 8px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
}

.attention-dot {
    width: 8px;
    height: 8px;
    background: red;
    border-radius: 50%;
    display: inline-block;
}

.pay-container {
    max-width: 420px;
    margin: 40px auto;
    padding: 20px;
    font-family: system-ui, sans-serif;
}

.order-box {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.order-lines {
    list-style: none;
    padding: 0;
}

    .order-lines li {
        display: flex;
        justify-content: space-between;
        margin-bottom: 8px;
    }

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
}

.pay-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    background: #635bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

    .pay-btn:hover {
        background: #524cff;
    }

.secure-note {
    margin-top: 12px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.inbox-row:hover {
    background-color: #f8f9fa;
}