@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #166534;
    --primary-dark: #14532d;
    --secondary: #16a34a;
    --accent: #eab308;
    --accent-soft: #fef3c7;
    --success: #15803d;
    --danger: #ef4444;
    --warning: #d97706;
    --light: #f0fdf4;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-tint: #f6fbf7;
    --text: #1e293b;
    --text-soft: #64748b;
    --border: #d6efd9;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 28px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.18);
    --sidebar-w: 260px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font);
    background: linear-gradient(135deg, #f7fcf7 0%, #eef9f0 100%);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

body.sidebar-open,
body.user-modal-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(246, 251, 247, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(22, 163, 74, 0.15);
    border-radius: 999px;
    transition: background 200ms ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(22, 163, 74, 0.25);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(22, 163, 74, 0.15) rgba(246, 251, 247, 0.3);
}

.auth-shell {
    min-height: 100vh;
    background: linear-gradient(135deg, #f4fbf5 0%, #ecf8ef 100%);
}

.app-shell {
    background: #f6fbf7;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #166534 0%, #14532d 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 200ms ease;
}

.sidebar-logo {
    padding: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
}

.brand-monogram {
    width: 42px;
    min-width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #fef3c7 0%, #facc15 100%);
    color: #14532d;
    font-weight: 800;
    font-size: 1.1rem;
}

.sidebar-logo h1 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.sidebar-logo p,
.sidebar-logo small {
    display: block;
    margin-top: 0.2rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.3;
    font-size: 0.7rem;
}

.sidebar-logo small {
    font-size: 0.65rem;
}

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

.nav-section {
    padding: 0.45rem 1.1rem 0.15rem;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.48);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1.1rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.8rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.nav-link:hover,
.nav-link.active,
.nav-link.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-left-color: #facc15;
}

.nav-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0 0.35rem;
}

.sidebar-footer {
    padding: 0.85rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-account {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sidebar-account img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.18);
}

.sidebar-account strong,
.sidebar-account small {
    display: block;
}

.sidebar-account strong {
    color: #ffffff;
    font-size: 0.8rem;
}

.sidebar-account small,
.sidebar-meta {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.68rem;
}

.sidebar-meta {
    display: grid;
    gap: 0.2rem;
    margin-top: 0.8rem;
}

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.topbar-left,
.topbar-right,
.inline-actions,
.toolbar,
.section-toolbar,
.link-row,
.checkbox-row,
.chip-row,
.meta-row,
.help-input-row,
.welcome-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.topbar-left {
    flex: 1;
}

.topbar-kicker {
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-soft);
}

.topbar-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}

.notification-pill,
.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    font-size: 0.75rem;
}

.notification-pill strong,
.profile-chip strong {
    font-weight: 700;
}

.notification-pill span:last-child {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #92400e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
}

.profile-chip img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-chip span {
    display: grid;
    gap: 0.1rem;
}

.profile-chip small {
    color: var(--text-soft);
    font-size: 0.66rem;
}

.page-content {
    padding: 1.2rem;
    flex: 1;
}

.content-shell {
    display: grid;
    gap: 1.2rem;
}

.panel,
.table-card,
.timeline-card,
.chart-card,
.profile-card,
.auth-card,
.hero-panel,
.quick-card,
.metric-card,
.summary-banner,
.summary-stat,
.smarts-slideshow,
.smarts-slide-panel,
.welcome-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.panel,
.table-card,
.timeline-card,
.chart-card,
.profile-card,
.auth-card {
    padding: 1.1rem;
}

.auth-layout {
    width: min(1180px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 2rem 1.1rem;
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 1.5rem;
    align-items: stretch;
}

.hero-panel {
    position: relative;
    overflow: hidden;
    padding: 2rem;
    background:
        radial-gradient(circle at top right, rgba(250, 204, 21, 0.24), transparent 28%),
        radial-gradient(circle at bottom left, rgba(22, 163, 74, 0.16), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, #f4fbf6 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title,
.content-shell h1,
.content-shell h2,
.content-shell h3,
.auth-card h1,
.profile-card h1,
.welcome-text h2 {
    margin: 0;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.hero-title {
    font-size: clamp(2.1rem, 4vw, 3.4rem);
    max-width: 12ch;
}

.eyebrow {
    margin: 0 0 0.6rem;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary);
}

.hero-subtitle,
.helper-text,
.panel p,
.summary-copy p,
.timeline-content p,
.auth-logo p,
.auth-logo small,
.auth-note,
.quick-card span,
.detail-item span,
.detail-item div,
.summary-stat span,
.summary-step-copy p,
.smarts-slide-copy p,
.smarts-slide-note span,
.welcome-text p {
    color: var(--text-soft);
}

.hero-grid,
.metrics-grid,
.detail-grid,
.grid-form.two,
.dashboard-grid.two-column,
.split-grid {
    display: grid;
    gap: 1rem;
}

.hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1.5rem;
}

.quick-card {
    padding: 1rem;
}

.quick-card strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
    color: var(--primary-dark);
}

.seal-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.seal-placeholder {
    min-height: 86px;
    display: grid;
    place-items: center;
    padding: 1rem;
    text-align: center;
    border-radius: var(--radius-md);
    border: 1px dashed #b7d9bd;
    background: rgba(255, 255, 255, 0.8);
    color: var(--primary-dark);
    font-weight: 600;
}

.auth-card {
    align-self: center;
    max-width: 460px;
    width: 100%;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.4rem;
}

.auth-brand-badge {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    margin: 0 auto 0.9rem;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #166534 0%, #16a34a 100%);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: 0 14px 30px rgba(22, 101, 52, 0.24);
}

.auth-brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.04em;
}

.auth-logo p,
.auth-logo small {
    display: block;
    margin-top: 0.25rem;
}

.auth-note {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    border: 1px solid #e2e8f0;
    font-size: 0.84rem;
}

.grid-form {
    display: grid;
    gap: 1rem;
}

.grid-form.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-form.two > .inline-actions,
.grid-form.two > .form-note,
.grid-form.two > .helper-text {
    grid-column: 1 / -1;
}

.form-group {
    display: grid;
    gap: 0.45rem;
}

label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d7e5d9;
    background: #ffffff;
    color: #0f172a;
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    font-size: 0.82rem;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

input[disabled],
textarea[disabled] {
    background: #f8fafc;
    color: #64748b;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.pw-wrap {
    position: relative;
}

.pw-wrap input {
    padding-right: 3.7rem;
}

.pw-eye {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
}

.captcha-box {
    padding: 0.95rem 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(22, 163, 74, 0.1));
    border: 1px dashed #bfd8c2;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: 0.05em;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--secondary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--success);
    box-shadow: 0 12px 24px rgba(22, 163, 74, 0.2);
}

.btn-secondary {
    background: var(--accent);
    color: #4b3a00;
}

.btn-secondary:hover {
    background: #f59e0b;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-ghost,
.btn-outline {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-ghost:hover,
.btn-outline:hover {
    background: var(--surface-soft);
}

.btn-sm {
    padding: 0.45rem 0.7rem;
    font-size: 0.72rem;
}

.hamburger {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
}

.toolbar {
    justify-content: space-between;
}

.toolbar > div:first-child,
.section-toolbar > div:first-child {
    flex: 1;
}

.toolbar.compact {
    align-items: center;
    gap: 0.5rem;
}

.toolbar.compact a {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.link-row {
    justify-content: space-between;
}

.auth-link-row {
    font-size: 0.84rem;
}

.checkbox-row {
    color: var(--text-soft);
    font-size: 0.84rem;
}

.checkbox-row input {
    width: auto;
    margin: 0;
}

.inline-check {
    gap: 0.45rem;
}

.field-hint,
.form-note {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.form-note {
    padding: 0.8rem 0.95rem;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    border: 1px solid #e2e8f0;
}

.summary-banner {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
    padding: 1.35rem;
}

.summary-copy h1 {
    margin-bottom: 0.75rem;
}

.summary-stats {
    display: grid;
    gap: 0.85rem;
}

.summary-stat {
    padding: 1rem;
}

.summary-stat strong {
    display: block;
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 0.15rem;
}

.metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.metric-card {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.metric-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.metric-copy p {
    margin: 0 0 0.15rem;
    font-size: 0.72rem;
    color: var(--text-soft);
}

.metric-copy strong {
    font-size: 1.4rem;
    color: var(--text);
}

.accent-primary .metric-icon {
    background: rgba(22, 163, 74, 0.12);
    color: var(--secondary);
}

.accent-warning .metric-icon {
    background: rgba(245, 158, 11, 0.14);
    color: var(--warning);
}

.accent-success .metric-icon {
    background: rgba(21, 128, 61, 0.12);
    color: var(--success);
}

.accent-danger .metric-icon {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.dashboard-grid.two-column,
.split-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.table-card,
.timeline-card,
.chart-card,
.profile-card {
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

.table-card table,
.table-card tbody,
.table-card thead {
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 580px;
}

th,
td {
    padding: 0.7rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e6eef0;
    vertical-align: middle;
    font-size: 0.8rem;
}

th {
    background: #f5fbf7;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-soft);
}

tbody tr:hover {
    background: #fbfefc;
}

.table-card a,
.timeline-card a,
.panel a:not(.btn),
.flash a,
.link-row a {
    color: var(--primary);
}

.detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.detail-item {
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid #e2e8f0;
    display: grid;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.detail-item strong {
    color: var(--text);
}

.attachment-list,
.tool-chip-list {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.chip,
.tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.status-badge-lg {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
}

.status-summary-card {
    padding: 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
}

.workflow-message-block {
    white-space: normal;
    line-height: 1.6;
}

.status-draft { background: #f1f5f9; color: #475569; }
.status-submitted { background: #dbeafe; color: #1d4ed8; }
.status-received { background: #dcfce7; color: #166534; }
.status-assigned { background: #ede9fe; color: #6d28d9; }
.status-review { background: #fef3c7; color: #92400e; }
.status-returned { background: #fee2e2; color: #b91c1c; }
.status-processing { background: #cffafe; color: #155e75; }
.status-endorsed { background: #ffedd5; color: #c2410c; }
.status-awaiting-release { background: #ede9fe; color: #5b21b6; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-completed { background: #dcfce7; color: #15803d; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-default { background: #f1f5f9; color: #334155; }

.timeline {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.timeline-step {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 0.9rem;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    margin-top: 0.35rem;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.14);
}

.timeline-content strong {
    display: block;
    color: var(--text);
}

.timeline-content small {
    color: var(--text-soft);
    font-size: 0.76rem;
}

.summary-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.summary-step {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 0.85rem;
    align-items: flex-start;
}

.summary-step-index {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #166534;
    color: #ffffff;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.summary-step-copy strong {
    display: block;
    margin-bottom: 0.2rem;
}

.bar-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.bar-item {
    display: grid;
    gap: 0.4rem;
}

.bar-line {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e7eef1;
    overflow: hidden;
}

.bar-line span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #166534 0%, #16a34a 100%);
}

.user-table-person {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    object-fit: cover;
}

.profile-card img,
.sidebar-account img,
.profile-chip img,
.user-avatar {
    box-shadow: var(--shadow-sm);
}

.flash {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 0.88rem;
}

.flash-success { background: #ecfdf3; color: #166534; border-color: #ccead5; }
.flash-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.flash-warning { background: #fff7ed; color: #b45309; border-color: #fed7aa; }
.flash-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

.floating-flash {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 200;
    min-width: 260px;
}

.page-modal-layer {
    position: fixed;
    inset: 0;
    z-index: 160;
    pointer-events: none;
}

.page-modal-layer[hidden] {
    display: none;
}

.page-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    transition: opacity 180ms ease;
}

.page-modal-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 18px));
    width: min(94vw, 860px);
    max-height: 90vh;
    overflow: auto;
    padding: 1.5rem;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease;
}

.page-modal-card .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.user-modal-open .page-modal-layer,
.page-modal-layer.is-open {
    pointer-events: auto;
}

.user-modal-open .page-modal-backdrop,
.page-modal-layer.is-open .page-modal-backdrop {
    opacity: 1;
}

.user-modal-open .page-modal-card,
.page-modal-layer.is-open .page-modal-card {
    transform: translate(-50%, -50%);
    opacity: 1;
    pointer-events: auto;
}

.modal-header {
    margin-bottom: 1rem;
}

.modal-header h2 {
    margin: 0.2rem 0 0.4rem;
}

.modal-close,
.help-widget-close {
    border: none;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

.reason-grid {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.reason-option {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    cursor: pointer;
}

.reason-option input {
    margin-top: 0.18rem;
}

.smarts-slideshow {
    position: relative;
    overflow: hidden;
    min-height: 360px;
    padding: 0;
    background: linear-gradient(135deg, #166534 0%, #14532d 100%);
    color: #ffffff;
}

.smarts-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 1rem;
    align-items: center;
    padding: 1.7rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 350ms ease;
}

.smarts-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.smarts-slide-copy .eyebrow,
.smarts-slide-copy p,
.smarts-slide-copy h1,
.smarts-slide-note,
.smarts-slide-stat strong,
.smarts-slide-stat span {
    color: #ffffff;
}

.smarts-slide-copy h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    margin-bottom: 0.75rem;
}

.smarts-slide-copy p {
    max-width: 58ch;
    color: rgba(255, 255, 255, 0.84);
}

.smarts-slide-panel {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
}

.smarts-slide-panel.stack {
    display: grid;
    gap: 0.85rem;
}

.smarts-slide-stat {
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.smarts-slide-stat span {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.66);
}

.smarts-slide-stat strong {
    display: block;
    margin-top: 0.3rem;
    font-size: 2rem;
}

.smarts-slide-note {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
}

.slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    cursor: pointer;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.slide-btn.prev {
    left: 1rem;
}

.slide-btn.next {
    right: 1rem;
}

.slide-dots {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.45rem;
    z-index: 3;
}

.slide-dot {
    width: 10px;
    height: 10px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.42);
    cursor: pointer;
}

.slide-dot.active {
    background: #ffffff;
    transform: scale(1.2);
}

.welcome-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.welcome-text h2 {
    font-size: 1.05rem;
    color: var(--primary-dark);
}

.help-desk {
    position: fixed;
    right: 1.3rem;
    bottom: 1.3rem;
    z-index: 170;
}

.help-fab {
    width: 54px;
    height: 54px;
    border: none;
    border-radius: 50%;
    background: var(--secondary);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.help-widget {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: min(360px, calc(100vw - 2rem));
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.help-widget[hidden] {
    display: none !important;
}

.help-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    background: #166534;
    color: #ffffff;
}

.help-widget-header strong,
.help-widget-header small {
    display: block;
}

.help-widget-header small {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
}

.help-messages {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.95rem;
    background: #fcfffd;
}

.help-msg {
    max-width: 88%;
    padding: 0.65rem 0.8rem;
    border-radius: 14px;
    font-size: 0.82rem;
    line-height: 1.5;
}

.help-msg.bot {
    background: #f0fdf4;
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.help-msg.user {
    background: var(--secondary);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.help-faqs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.85rem 0.95rem;
    border-top: 1px solid #edf2ef;
}

.faq-chip {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
    font-size: 0.73rem;
    font-weight: 700;
}

.help-input-row {
    padding: 0.85rem 0.95rem;
    border-top: 1px solid #edf2ef;
}

.help-input-row input {
    flex: 1;
}

.w-full {
    width: 100%;
}

#filePreviewModal .page-modal-backdrop {
    opacity: 0;
    transition: opacity 200ms ease;
}

#filePreviewModal .page-modal-card {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 20px));
    transition: transform 200ms ease, opacity 200ms ease;
}

#filePreviewContent::-webkit-scrollbar {
    width: 12px;
}

#filePreviewContent::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
}

#filePreviewContent::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 6px;
    border: 2px solid #f1f5f9;
}

#filePreviewContent::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

#filePreviewContent img {
    animation: fadeIn 300ms ease;
}

#filePreviewContent iframe,
#filePreviewContent object {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

#dynamic-fields {
    padding: 1rem;
    border-radius: 12px;
    background: rgba(22, 163, 74, 0.04);
    border: 2px dashed rgba(22, 163, 74, 0.2);
    min-height: 60px;
    display: grid;
    gap: 1rem;
    grid-column: 1 / -1;
}

#dynamic-fields:not(:empty) {
    background: rgba(22, 163, 74, 0.06);
    border-style: solid;
    border-color: rgba(22, 163, 74, 0.3);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#dynamic-fields .form-group {
    display: grid;
    gap: 0.45rem;
}

#dynamic-fields:empty::before {
    content: 'Select a transaction type above to load dynamic fields here';
    display: block;
    text-align: center;
    color: var(--text-soft);
    font-size: 0.8rem;
    font-style: italic;
    padding: 1rem;
}

@media (max-width: 768px) {
    #dynamic-fields:not(:empty) {
        grid-template-columns: 1fr;
    }
}

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

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

    body.sidebar-open .sidebar-overlay,
    .sidebar-overlay.open {
        opacity: 1;
        visibility: visible;
    }

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

    .hamburger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .auth-layout,
    .summary-banner,
    .dashboard-grid.two-column,
    .split-grid,
    .smarts-slide {
        grid-template-columns: 1fr;
    }

    .smarts-slide {
        padding-bottom: 4rem;
    }
}

@media (max-width: 768px) {
    .topbar,
    .topbar-left,
    .topbar-right,
    .toolbar,
    .section-toolbar,
    .inline-actions,
    .link-row,
    .welcome-bar,
    .help-input-row {
        align-items: flex-start;
    }

    .topbar,
    .topbar-left,
    .topbar-right,
    .toolbar,
    .section-toolbar,
    .inline-actions,
    .link-row,
    .welcome-bar,
    .help-input-row {
        flex-direction: column;
    }

    .page-content,
    .topbar,
    .hero-panel,
    .auth-card,
    .panel,
    .table-card,
    .timeline-card,
    .chart-card,
    .profile-card,
    .page-modal-card {
        padding: 1rem;
    }

    .hero-grid,
    .seal-row,
    .metrics-grid,
    .grid-form.two,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .notification-pill,
    .profile-chip,
    .btn,
    .help-input-row input {
        width: 100%;
    }

    .help-desk {
        right: 1rem;
        bottom: 1rem;
    }

    .slide-btn {
        display: none;
    }

    table {
        min-width: 520px;
    }
}

@media (max-width: 480px) {
    .auth-layout {
        padding: 1rem 0.75rem;
    }

    .hero-title,
    .smarts-slide-copy h1 {
        font-size: 1.8rem;
    }

    .floating-flash {
        left: 0.75rem;
        right: 0.75rem;
        min-width: 0;
    }
}





