/* ============================================================
   منظومة سند الصرف - الشركة المصرية للاتصالات
   Theme based on logo palette (#5B2C91 purple + white)
   ============================================================ */

:root {
    --primary: #5B2C91;
    --primary-dark: #431D6B;
    --primary-darker: #2C1252;
    --primary-light: #EDE6F6;
    --primary-soft: #F7F4FB;
    --lavender: #A98FD0;
    --lavender-light: #C9B8E5;
    --gold: #E8B64C;
    --gold-soft: #FBF3DE;
    --success: #1E8E4E;
    --success-soft: #E5F5EC;
    --danger: #C62828;
    --danger-soft: #FBE9E9;
    --warning: #B77810;
    --warning-soft: #FDF3DF;
    --info: #1268A8;
    --info-soft: #E4F0FA;
    --ink: #2A2A3A;
    --muted: #6B6B80;
    --line: #E7E1F0;
    --shadow: 0 8px 30px rgba(91, 44, 145, 0.10);
    --shadow-sm: 0 3px 12px rgba(91, 44, 145, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    font-family: "Segoe UI", "Tahoma", "Arial", sans-serif;
    background: var(--primary-soft);
    color: var(--ink);
    font-size: 14px;
}

body { background: var(--primary-soft); }

/* ---------------- App shell ---------------- */
.app-shell { display: flex; min-height: 100vh; }

/* ---------------- Sidebar ---------------- */
.sidebar {
    width: 272px;
    min-width: 272px;
    background: linear-gradient(175deg, var(--primary-darker) 0%, var(--primary) 60%, #7A3BB0 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 4px 0 24px rgba(44, 18, 82, 0.25);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 18px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    padding: 5px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.brand-text h2 { font-size: 15px; font-weight: 800; margin: 0; line-height: 1.3; }
.brand-text p { font-size: 11px; margin: 2px 0 0; color: var(--lavender-light); letter-spacing: 0.3px; }

.side-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }

.side-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #EAE3F5;
    text-decoration: none;
    padding: 11px 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13.5px;
    transition: all 0.18s ease;
}

.side-nav .nav-link:hover { background: rgba(255, 255, 255, 0.10); color: #fff; transform: translateX(-3px); }
.side-nav .nav-link.active { background: #fff; color: var(--primary); box-shadow: 0 4px 14px rgba(0,0,0,0.18); }

.nav-icon { font-size: 17px; width: 22px; text-align: center; }

.sidebar-footer { padding: 14px 18px; font-size: 11px; color: var(--lavender-light); border-top: 1px solid rgba(255,255,255,0.12); text-align: center; }

/* ---------------- Main wrap ---------------- */
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---------------- Topbar ---------------- */
.topbar {
    background: #fff;
    padding: 12px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(91, 44, 145, 0.06);
}

.topbar-title { display: flex; align-items: center; gap: 12px; }

.role-chip {
    background: var(--primary-light);
    color: var(--primary);
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.breadcrumb-title { font-size: 15px; font-weight: 700; color: var(--ink); }

.user-menu { display: flex; align-items: center; gap: 14px; }
.user-info { text-align: left; line-height: 1.25; }
.user-name { display: block; font-weight: 700; font-size: 13.5px; color: var(--primary-dark); }
.user-job { display: block; font-size: 11px; color: var(--muted); }

.btn-logout {
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 12.5px;
    transition: all 0.15s;
}
.btn-logout:hover { background: var(--danger); color: #fff; }

.hamburger { display: inline-block; width: 20px; height: 2px; background: var(--primary); position: relative; }
.hamburger::before, .hamburger::after { content: ""; position: absolute; width: 20px; height: 2px; background: var(--primary); right: 0; }
.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

/* ---------------- Content ---------------- */
.content { padding: 26px; flex: 1; }

/* ---------------- Flash alerts ---------------- */
.alert-flash {
    padding: 13px 18px;
    border-radius: 12px;
    font-weight: 700;
    margin-bottom: 18px;
    border-right: 5px solid;
    animation: slideDown 0.35s ease;
}
.alert-success { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ---------------- Cards ---------------- */
.card-e {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 20px;
}

.card-title-e {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 15.5px;
    color: var(--primary-dark);
    margin-bottom: 16px;
}

.card-title-e .step-num {
    width: 30px; height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), #7A3BB0);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
}

.card-title-e .section-icon { font-size: 20px; }

/* ---------------- Buttons ---------------- */
.btn-primary-e {
    background: linear-gradient(135deg, var(--primary) 0%, #7A3BB0 100%);
    color: #fff;
    border: none;
    padding: 11px 26px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 6px 18px rgba(91, 44, 145, 0.3);
    transition: all 0.18s;
}
.btn-primary-e:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(91, 44, 145, 0.38); color: #fff; }

.btn-outline-e {
    background: #fff;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.18s;
}
.btn-outline-e:hover { background: var(--primary-light); }

.btn-success-e { background: linear-gradient(135deg, var(--success), #2FB96A); color: #fff; border: none; padding: 10px 22px; border-radius: 12px; font-weight: 700; box-shadow: 0 6px 16px rgba(30,142,78,0.3); transition: 0.15s; }
.btn-success-e:hover { transform: translateY(-2px); color: #fff; }
.btn-danger-e { background: linear-gradient(135deg, var(--danger), #E53935); color: #fff; border: none; padding: 10px 22px; border-radius: 12px; font-weight: 700; box-shadow: 0 6px 16px rgba(198,40,40,0.28); transition: 0.15s; }
.btn-danger-e:hover { transform: translateY(-2px); color: #fff; }
.btn-ghost { background: var(--primary-light); color: var(--primary); border: none; padding: 9px 20px; border-radius: 12px; font-weight: 700; transition: 0.15s; }
.btn-ghost:hover { background: #ded3ef; }

/* ---------------- Forms ---------------- */
.form-label-e { font-weight: 700; font-size: 12.5px; color: var(--primary-dark); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.form-label-e .req { color: var(--danger); }

.form-control-e, .form-select-e {
    border: 1.5px solid var(--line);
    border-radius: 11px;
    padding: 10px 14px;
    font-size: 13.5px;
    transition: all 0.15s;
    background-color: #fff;
    width: 100%;
    color: var(--ink);
}
.form-control-e:focus, .form-select-e:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(91, 44, 145, 0.12);
    outline: none;
}
.form-control-e::placeholder { color: #B4A9C9; }

.field-validation-error { color: var(--danger); font-size: 11.5px; font-weight: 600; }
.input-validation-error { border-color: var(--danger) !important; }

/* ---------------- Segmented control (approval authority) ---------------- */
.segment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--primary-soft);
    padding: 6px;
    border-radius: 13px;
    border: 1px solid var(--line);
}
.segment label {
    text-align: center;
    padding: 10px 12px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
    transition: all 0.18s;
    margin: 0;
}
.segment input { display: none; }
.segment input:checked + label {
    background: linear-gradient(135deg, var(--primary), #7A3BB0);
    color: #fff;
    box-shadow: 0 4px 12px rgba(91, 44, 145, 0.3);
}

/* ---------------- Items table ---------------- */
.table-items { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.table-items thead th {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 12.5px;
    font-weight: 800;
    padding: 10px 12px;
    white-space: nowrap;
}
.table-items thead th:first-child { border-radius: 10px 0 0 10px; }
.table-items thead th:last-child { border-radius: 0 10px 10px 0; }
.table-items tbody td { padding: 6px 8px; vertical-align: middle; }
.table-items tbody tr { background: #fff; border: 1px solid var(--line); }
.table-items tbody tr td:first-child { border-right: 4px solid var(--lavender); border-radius: 10px 0 0 10px; }
.table-items tbody tr td:last-child { border-radius: 0 10px 10px 0; }
.table-items tbody tr:hover { box-shadow: var(--shadow-sm); }

.item-row .form-control-e, .item-row .form-select-e { background: var(--primary-soft); }

.btn-remove-row {
    width: 34px; height: 34px;
    border-radius: 9px;
    border: none;
    background: var(--danger-soft);
    color: var(--danger);
    font-weight: 800;
    transition: 0.15s;
}
.btn-remove-row:hover { background: var(--danger); color: #fff; }

/* ---------------- Totals panel ---------------- */
.totals-panel {
    background: linear-gradient(135deg, var(--primary-darker), var(--primary));
    color: #fff;
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow);
}
.totals-panel .total-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,0.2); }
.totals-panel .total-row:last-child { border-bottom: none; }
.totals-panel .total-label { font-weight: 700; font-size: 13.5px; color: var(--lavender-light); }
.totals-panel .total-value { font-weight: 800; font-size: 17px; }
.totals-panel .grand-total { font-size: 21px; color: var(--gold); }
.totals-panel .words-box {
    margin-top: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px dashed rgba(255,255,255,0.35);
    border-radius: 12px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.9;
}

.totals-panel .net-box {
    background: rgba(232, 182, 76, 0.16);
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 10px 14px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.totals-panel .net-box .net-label { font-weight: 700; color: var(--gold); }
.totals-panel .net-box .net-value { font-weight: 800; font-size: 19px; color: var(--gold); }

/* ---------------- Badges ---------------- */
.badge-status {
    display: inline-block;
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 800;
    white-space: nowrap;
}
.badge-pending { background: var(--warning-soft); color: var(--warning); border: 1px solid var(--gold); }
.badge-approval { background: var(--info-soft); color: var(--info); border: 1px solid var(--info); }
.badge-returned { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }
.badge-approved { background: var(--success-soft); color: var(--success); border: 1px solid var(--success); }
.badge-rejected { background: #F1F1F4; color: #7A7A8C; border: 1px solid #D9D9E0; }

/* ---------------- Dashboard ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: 0.18s;
    text-decoration: none;
    color: var(--ink);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.stat-icon.purple { background: var(--primary-light); }
.stat-icon.green { background: var(--success-soft); }
.stat-icon.gold { background: var(--gold-soft); }
.stat-icon.red { background: var(--danger-soft); }
.stat-icon.blue { background: var(--info-soft); }
.stat-body .stat-num { font-size: 24px; font-weight: 800; color: var(--primary-dark); line-height: 1.1; }
.stat-body .stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }

.welcome-banner {
    background: linear-gradient(120deg, var(--primary-darker), var(--primary) 55%, #7A3BB0);
    color: #fff;
    border-radius: var(--radius);
    padding: 26px 30px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.welcome-banner h1 { font-size: 20px; font-weight: 800; margin: 0 0 4px; }
.welcome-banner p { margin: 0; color: var(--lavender-light); font-size: 13px; }

/* ---------------- Tables ---------------- */
.table-e { width: 100%; background: #fff; border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.table-e thead th {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 12.5px;
    padding: 13px 14px;
    text-align: right;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table-e tbody td { padding: 12px 14px; border-bottom: 1px solid #F1EDF7; font-size: 13px; vertical-align: middle; }
.table-e tbody tr:hover { background: var(--primary-soft); }
.table-e tbody tr:last-child td { border-bottom: none; }

/* ---------------- Tabs ---------------- */
.tabs-e { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab-e {
    padding: 9px 18px;
    border-radius: 999px;
    background: #fff;
    border: 1.5px solid var(--line);
    color: var(--muted);
    font-weight: 700;
    font-size: 12.5px;
    text-decoration: none;
    transition: 0.15s;
}
.tab-e:hover { border-color: var(--lavender); color: var(--primary); text-decoration: none; }
.tab-e.active { background: linear-gradient(135deg, var(--primary), #7A3BB0); color: #fff; border-color: transparent; box-shadow: 0 5px 14px rgba(91,44,145,0.3); }
.tab-e .tab-count { background: rgba(255,255,255,0.2); border-radius: 999px; padding: 1px 8px; margin-right: 6px; font-size: 11px; }

/* ---------------- Details form preview ---------------- */
.form-preview {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 26px;
}
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.preview-header .doc-title { font-size: 20px; font-weight: 800; color: var(--primary-dark); }
.preview-header .doc-title small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }

.preview-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.meta-box { background: var(--primary-soft); border-radius: 12px; padding: 10px 14px; border: 1px solid var(--line); }
.meta-box .meta-label { font-size: 11px; font-weight: 700; color: var(--muted); display: block; }
.meta-box .meta-value { font-size: 14px; font-weight: 800; color: var(--primary-dark); }

.section-divider { border: none; border-top: 1.5px dashed var(--lavender); margin: 18px 0; }

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-soft);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 7px 13px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--primary-dark);
    text-decoration: none;
    transition: 0.15s;
    margin: 0 0 8px 8px;
}
.attachment-chip:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; box-shadow: var(--shadow-sm); }
.attachment-chip .chip-icon { font-size: 16px; }
.attachment-chip.tax-invoice { background: var(--gold-soft); border-color: rgba(212, 175, 55, 0.45); color: #7a5d00; }
.attachment-chip.tax-invoice:hover { background: rgba(212, 175, 55, 0.2); }

/* Type selector */
.steps-hint { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.9); flex-wrap: wrap; }
.hint-dot { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.4); }
.hint-dot.active { background: var(--gold); border-color: var(--gold); color: var(--primary-dark); }
.hint-arrow { color: rgba(255,255,255,.6); font-size: 16px; }

.type-card { border-color: var(--line); border-right: 5px solid var(--primary); transition: 0.2s; }
.type-card:hover { box-shadow: var(--shadow-sm); }
.type-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 16px; font-size: 30px;
    background: var(--primary-soft); border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.type-count {
    background: var(--gold-soft); color: var(--gold); font-weight: 800; font-size: 12px;
    border-radius: 999px; padding: 6px 14px; border: 1px solid rgba(212,175,55,.4); white-space: nowrap;
}
.doc-list {
    margin: 0; padding-right: 22px; display: grid; gap: 8px;
    counter-reset: doc;
}
.doc-list li {
    position: relative; padding: 9px 14px; background: var(--primary-soft);
    border: 1px solid var(--line); border-radius: 11px; font-size: 13px; line-height: 1.7;
    list-style: none;
}
.doc-list li::before {
    counter-increment: doc; content: counter(doc);
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; margin-left: 9px;
    background: var(--primary); color: #fff; font-weight: 800; font-size: 11px;
    border-radius: 50%;
}

/* Workflow timeline */
.timeline { position: relative; padding-right: 22px; }
.timeline::before { content: ""; position: absolute; right: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
    content: "";
    position: absolute;
    right: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--primary-light);
}
.timeline-item.return::before { background: var(--danger); border-color: var(--danger-soft); }
.timeline-item.approve::before { background: var(--success); border-color: var(--success-soft); }
.timeline-item .tl-head { font-weight: 800; font-size: 13px; color: var(--ink); }
.timeline-item .tl-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.timeline-item .tl-note { background: var(--warning-soft); border-right: 3px solid var(--gold); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; margin-top: 6px; }

/* Note alert for returned forms */
.note-banner {
    background: linear-gradient(120deg, #B71C1C, var(--danger));
    color: #fff;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.note-banner .note-title { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.note-banner .note-text { font-size: 13px; line-height: 1.7; }
.note-banner .note-meta { font-size: 11.5px; color: #FFD6D6; margin-top: 8px; }

/* ---------------- Login page ---------------- */
.login-page {
    min-height: 100vh;
    display: flex;
    background:
        radial-gradient(900px 500px at 100% -10%, #F0EAF9 0%, transparent 60%),
        radial-gradient(700px 420px at -10% 110%, #E4EAF6 0%, transparent 55%),
        var(--primary-soft);
}

/* ----- Left hero panel ----- */
.login-hero {
    flex: 1;
    background: linear-gradient(155deg, var(--primary-darker) 0%, var(--primary) 55%, #7A3BB0 100%);
    background-size: 200% 200%;
    animation: heroShift 16s ease infinite;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 50px;
    position: relative;
    overflow: hidden;
}
@keyframes heroShift {
    0% { background-position: 0% 30%; }
    50% { background-position: 100% 70%; }
    100% { background-position: 0% 30%; }
}
.login-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
    opacity: .5;
    pointer-events: none;
}
.hero-inner { max-width: 620px; width: 100%; position: relative; z-index: 2; }

.hero-orbs span { position: absolute; border-radius: 50%; pointer-events: none; }
.orb-1 { width: 340px; height: 340px; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), rgba(255,255,255,0.03) 65%); top: -90px; left: -90px; animation: orbFloat 9s ease-in-out infinite; }
.orb-2 { width: 220px; height: 220px; background: radial-gradient(circle at 60% 40%, rgba(232,182,76,0.22), rgba(232,182,76,0.04) 70%); bottom: 40px; left: 26%; animation: orbFloat 12s ease-in-out infinite reverse; }
.orb-3 { width: 150px; height: 150px; background: radial-gradient(circle at 40% 60%, rgba(169,143,208,0.35), rgba(169,143,208,0.05) 70%); top: 22%; right: -50px; animation: orbFloat 10s ease-in-out 1s infinite; }
.orb-4 { width: 90px; height: 90px; border: 1px solid rgba(255,255,255,0.25); bottom: -30px; right: 18%; animation: orbFloat 7s ease-in-out .5s infinite; }
@keyframes orbFloat {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-22px) translateX(10px); }
}

.login-hero .login-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.login-hero .login-brand img { width: 62px; height: 62px; border-radius: 50%; background: #fff; padding: 6px; box-shadow: 0 8px 22px rgba(0,0,0,0.25); }
.login-hero .login-brand h1 { font-size: 18px; font-weight: 800; margin: 0 0 4px; }
.brand-badge {
    display: inline-block;
    background: rgba(232, 182, 76, 0.18);
    border: 1px solid rgba(232, 182, 76, 0.55);
    color: #FFE5A3;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
}

.hero-title { margin-bottom: 16px; }
.hero-title .hero-word { display: block; }
.hero-title .hero-word:first-child { font-size: 30px; font-weight: 800; letter-spacing: 0.3px; }
.hero-title .hero-gold {
    font-size: 42px;
    font-weight: 900;
    background: linear-gradient(120deg, #FFE5A3, var(--gold) 55%, #FFF3CD);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.3;
}
.hero-sub { color: var(--lavender-light); font-size: 14px; line-height: 2; margin-bottom: 24px; max-width: 520px; }

.hero-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 26px; }
.feature-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.20);
    border-radius: 14px;
    padding: 12px 14px;
    transition: transform 0.2s ease, background 0.2s ease;
}
.feature-card:hover { transform: translateY(-3px); background: rgba(255,255,255,0.16); }
.feature-ico { font-size: 20px; }
.feature-card strong { display: block; font-size: 12.5px; margin-bottom: 2px; }
.feature-card span:last-child { font-size: 11px; color: var(--lavender-light); line-height: 1.6; }

.hero-chain { background: rgba(0,0,0,0.18); border: 1px solid rgba(255,255,255,0.16); border-radius: 14px; padding: 14px 16px; }
.chain-title { font-size: 11.5px; font-weight: 800; color: var(--lavender-light); margin-bottom: 10px; letter-spacing: 0.3px; }
.chain-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chain-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
}
.chain-step b {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}
.chain-arrow { color: rgba(255,255,255,0.55); font-size: 15px; }

/* ----- Right login card ----- */
.login-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .login-logo-center { text-align: center; margin-bottom: 16px; }
.login-card .login-logo-center img { width: 76px; height: 76px; border-radius: 50%; box-shadow: var(--shadow); border: 3px solid #fff; }

.login-card-e {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(91, 44, 145, 0.16);
}
.login-card-e::before {
    content: "";
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), #7A3BB0, var(--gold));
}
.login-card-e .card-title-e { justify-content: center; font-size: 17px; }

.login-input-wrap { position: relative; margin-bottom: 16px; }
.login-input-wrap .login-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; opacity: 0.65; }
.login-input-wrap input {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 13px 44px 13px 16px;
    font-size: 14px;
    background: var(--primary-soft);
    transition: 0.15s;
}
.login-input-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(91,44,145,0.12); outline: none; background: #fff; }

.btn-login { display: flex; align-items: center; justify-content: center; gap: 8px; }

.demo-box { background: var(--primary-light); border-radius: 12px; padding: 14px 18px; margin-top: 22px; font-size: 12.5px; color: var(--primary-dark); line-height: 1.8; }
.demo-box strong { display: block; margin-bottom: 6px; }

/* ---------------- Print ---------------- */
@media print {
    .sidebar, .topbar, .no-print, .alert-flash { display: none !important; }
    .content { padding: 0; }
    .form-preview { box-shadow: none; border: 1px solid #000; }
    body { background: #fff; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 991px) {
    .sidebar { position: fixed; right: 0; transform: translateX(110%); transition: transform 0.25s ease; }
    .sidebar.open { transform: none; box-shadow: -10px 0 40px rgba(0,0,0,0.3); }
    .main-wrap { width: 100%; }
    .login-page { flex-direction: column; }
    .login-hero { display: none; }
    .content { padding: 16px; }
}

@media (min-width: 992px) {
    #sidebarToggle { display: none; }
}
barToggle { display: none; }
}
