/* ============================================================
   DigiRG Cloud — Design System
   Dark Professional Theme
   ============================================================ */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
    --bg:         #0f172a;
    --surface:    #1e293b;
    --border:     #334155;
    --primary:    #3b82f6;
    --secondary:  #f97316;
    --success:    #22c55e;
    --danger:     #ef4444;
    --warning:    #eab308;
    --purple:     #a855f7;
    --text:       #f1f5f9;
    --text-muted: #94a3b8;
    --radius:     12px;
    --sidebar-w:  240px;
    --font:       'Plus Jakarta Sans', sans-serif;
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ---------- Typography ---------- */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.5px; }
h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.3px; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */

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

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

.sidebar-brand .logo-icon {
    font-size: 1.4rem;
    color: var(--primary);
}

.sidebar-brand h2 {
    font-size: 1.1rem;
    color: var(--text);
    font-weight: 700;
}

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

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-muted);
    font-size: 0.93rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    color: var(--text);
    background: rgba(59, 130, 246, 0.08);
    text-decoration: none;
}

.sidebar-nav a.active {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--primary);
}

.sidebar-nav .nav-icon {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
}

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

.sidebar-footer .admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sidebar-footer .admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.sidebar-footer .admin-name {
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--text);
}

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

/* ---------- Main Content ---------- */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 0;
}

.topbar {
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar h1 {
    font-size: 1.35rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: 0.5; }

.page-content {
    padding: 28px 32px;
}

/* ---------- Mobile sidebar toggle ---------- */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h2, .card-header h3 {
    margin: 0;
}

/* ---------- Stat Cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
}

.stat-card .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover { opacity: 0.88; text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary   { background: var(--primary); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-danger    { background: var(--danger);  color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-outline   { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; border-radius: 6px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-copy { background: #475569; color: #fff; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.93rem;
    transition: border-color 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-prefix {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: var(--border);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 0.93rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-group .form-control {
    border-radius: 0 8px 8px 0;
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

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

.form-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.form-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.form-check label {
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    margin-bottom: 0;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table thead th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

table tbody tr:nth-child(even) {
    background: rgba(30, 41, 59, 0.5);
}

table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

table tbody td {
    padding: 13px 16px;
    color: var(--text);
    vertical-align: middle;
}

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

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.badge-info    { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-success { background: rgba(34,197,94,0.15);  color: #4ade80; }
.badge-warning { background: rgba(234,179,8,0.15);  color: #facc15; }
.badge-danger  { background: rgba(239,68,68,0.15);  color: #f87171; }
.badge-purple  { background: rgba(168,85,247,0.15); color: #c084fc; }
.badge-muted   { background: rgba(148,163,184,0.12); color: #94a3b8; }
.badge-secondary { background: rgba(249,115,22,0.15); color: #fb923c; }

/* ============================================================
   ALERTS / MESSAGES
   ============================================================ */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: rgba(34,197,94,0.12); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.alert-danger  { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.alert-info    { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.alert-warning { background: rgba(234,179,8,0.12); color: #facc15; border: 1px solid rgba(234,179,8,0.2); }

/* ============================================================
   CLIENT PORTAL LAYOUT
   ============================================================ */
.portal-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.portal-card {
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.portal-brand {
    text-align: center;
    padding: 28px 24px 8px;
}

.portal-brand .logo-icon {
    font-size: 1.6rem;
    color: var(--primary);
}

.portal-brand h1 {
    font-size: 1.2rem;
    color: var(--text);
    margin-top: 6px;
}

.portal-body {
    padding: 24px 32px 32px;
}

.portal-title {
    text-align: center;
    margin-bottom: 8px;
}

.portal-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

/* ---------- Step Progress Bar ---------- */
.step-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    gap: 0;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 0;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    border: 2px solid var(--border);
    color: var(--text-muted);
    background: var(--bg);
    transition: all 0.3s;
    flex-shrink: 0;
}

.step-item.active .step-circle {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.step-item.completed .step-circle {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.step-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 6px;
    white-space: nowrap;
}

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

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin: 0 8px;
    flex-shrink: 0;
}

.step-item.completed + .step-line,
.step-line.completed {
    background: var(--success);
}

/* ---------- Info Box ---------- */
.info-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px 20px;
    margin: 20px 0;
}

.info-box p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.info-box p:last-child { margin-bottom: 0; }

.info-box .check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text);
    margin-bottom: 6px;
}

.info-box .check-icon {
    color: var(--success);
}

/* ---------- Project Info Card ---------- */
.project-info {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px 20px;
    margin: 16px 0;
}

.project-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.project-info .info-row:last-child { border-bottom: none; }
.project-info .info-label { color: var(--text-muted); font-size: 0.85rem; }
.project-info .info-value { color: var(--text); font-weight: 600; font-size: 0.9rem; }

/* ---------- OTP Input ---------- */
.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 24px 0;
}

.otp-inputs input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.otp-inputs input:focus {
    border-color: var(--primary);
}

.resend-timer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 12px;
}

.resend-timer a {
    color: var(--primary);
    cursor: pointer;
}

.resend-timer a.disabled {
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0.5;
}

/* ---------- KYC Upload ---------- */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 20px;
    position: relative;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(59,130,246,0.04);
}

.upload-zone.has-file {
    border-color: var(--success);
    border-style: solid;
}

.upload-zone input[type="file"] {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-zone .upload-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.upload-zone .upload-text {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.upload-zone .upload-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 4px;
}

.upload-preview {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    max-height: 200px;
}

.upload-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
}

/* ---------- Doc Type Cards ---------- */
.doc-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0 24px;
}

.doc-type-card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.doc-type-card:hover { border-color: var(--text-muted); }

.doc-type-card.selected {
    border-color: var(--primary);
    background: rgba(59,130,246,0.06);
}

.doc-type-card .doc-icon {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.doc-type-card .doc-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
}

.doc-type-card input[type="radio"] { display: none; }

/* ---------- Agreement Scroll ---------- */
.agreement-scroll {
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text);
}

.agreement-scroll h2 { font-size: 1.2rem; margin-bottom: 16px; color: var(--primary); }
.agreement-scroll h3 { font-size: 1rem; margin: 20px 0 8px; color: var(--text); }
.agreement-scroll p  { margin-bottom: 12px; color: var(--text-muted); }

.agreement-scroll::-webkit-scrollbar { width: 6px; }
.agreement-scroll::-webkit-scrollbar-track { background: var(--bg); }
.agreement-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ---------- Success Card ---------- */
.success-card {
    text-align: center;
    padding: 40px 24px;
}

.success-card .success-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.success-card h2 {
    margin-bottom: 8px;
}

.success-card p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ---------- Copy Link Box ---------- */
.copy-box {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.copy-box input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    outline: none;
}

.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ============================================================
   ADMIN LOGIN
   ============================================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
}

.login-card .login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .login-brand .logo-icon {
    font-size: 2rem;
    color: var(--primary);
}

.login-card .login-brand h1 {
    font-size: 1.3rem;
    margin-top: 10px;
}

.login-card .login-brand p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 4px;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    gap: 0;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-pill:hover { border-color: var(--primary); color: var(--primary); }
.filter-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.search-box {
    position: relative;
}

.search-box input {
    padding: 9px 14px 9px 36px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.88rem;
    outline: none;
    width: 240px;
    transition: border-color 0.2s;
}

.search-box input:focus { border-color: var(--primary); }

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================================
   TWO-COLUMN LAYOUT
   ============================================================ */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--surface);
}

.timeline-item .tl-action {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text);
}

.timeline-item .tl-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================================
   DETAIL ROWS
   ============================================================ */
.detail-grid {
    display: grid;
    gap: 12px;
}

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

.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); font-size: 0.87rem; }
.detail-value { color: var(--text); font-weight: 600; font-size: 0.9rem; text-align: right; }

/* ============================================================
   IMAGE VIEWER
   ============================================================ */
.image-viewer {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
}

.image-viewer img {
    max-height: 360px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.image-viewer img:hover { transform: scale(1.02); }

.image-viewer .img-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 10px;
    font-weight: 600;
}

/* Image modal / lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.lightbox.active { display: flex; }

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    background: none;
    border: none;
}

/* ============================================================
   PAGINATION (optional)
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s;
}

.pagination a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================
   REJECT TEXTAREA PANEL
   ============================================================ */
.reject-panel {
    display: none;
    margin-top: 16px;
}

.reject-panel.visible {
    display: block;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ============================================================
   SCROLLBAR (global)
   ============================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .sidebar-toggle {
        display: block;
    }

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

    .topbar {
        padding: 16px 20px;
    }

    .page-content {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-box input {
        width: 100%;
    }

    .doc-type-grid {
        grid-template-columns: 1fr;
    }

    .portal-body {
        padding: 20px;
    }

    .step-label {
        display: none;
    }

    .step-line {
        width: 24px;
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }

    .otp-inputs input {
        width: 42px;
        height: 48px;
        font-size: 1.1rem;
    }

    .copy-box {
        flex-direction: column;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-buttons .btn {
        width: 100%;
    }

    table {
        font-size: 0.82rem;
    }

    table thead th,
    table tbody td {
        padding: 10px 12px;
    }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none !important; }
.w-full { width: 100%; }
