/* ==========================================================================
   FACTORING UI V4 - EON THEME
   Readable, clean, brand-aligned
   ========================================================================== */

:root {
    --brand-primary: #d62828;
    --brand-primary-hover: #b91c1c;
    --brand-primary-soft: #fde8e8;
    --brand-primary-soft-2: #fff3f3;

    --brand-secondary: #7f1d1d;
    --brand-accent: #ef4444;

    --bg-app: #f6f7f9;
    --bg-card: #ffffff;
    --bg-muted: #f3f4f6;
    --bg-subtle: #fafafa;

    --text-main: #1f2937;
    --text-soft: #6b7280;
    --text-faint: #9ca3af;
    --text-inverse: #ffffff;

    --border-color: #e5e7eb;
    --border-strong: #d1d5db;

    --success: #15803d;
    --success-soft: #dcfce7;

    --warning: #b45309;
    --warning-soft: #fef3c7;

    --danger: #dc2626;
    --danger-soft: #fee2e2;

    --info: #2563eb;
    --info-soft: #dbeafe;

    --shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.12);

    --radius-xs: 10px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --sidebar-width: 280px;
    --topbar-height: 76px;

    --transition-fast: 0.18s ease;
    --transition-base: 0.24s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

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

svg {
    flex-shrink: 0;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--brand-primary-hover);
}

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

button {
    cursor: pointer;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 0.65rem;
    line-height: 1.25;
    color: var(--text-main);
    font-weight: 700;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.925rem; }

p {
    margin: 0 0 1rem;
    color: var(--text-soft);
}

small,
.text-muted,
.form-help,
.helper-text {
    color: var(--text-soft);
    font-size: 0.875rem;
}

.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-soft { color: var(--text-soft) !important; }
.text-main { color: var(--text-main) !important; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

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

.app-shell {
    min-height: 100vh;
    display: flex;
    background: var(--bg-app);
}

.app-sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.app-sidebar__header,
.sidebar-header {
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.brand,
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--text-main);
    font-weight: 800;
}

.brand-mark,
.sidebar-brand__mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(214, 40, 40, 0.22);
}

.brand-text,
.sidebar-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text strong,
.sidebar-brand__text strong {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 800;
}

.brand-text span,
.sidebar-brand__text span {
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 500;
}

.app-sidebar__body,
.sidebar-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.app-sidebar__footer,
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: #fff;
}

.sidebar-section-title,
.nav-section-title {
    margin: 0.5rem 0 0.75rem;
    padding: 0 0.7rem;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 700;
}

.sidebar-nav,
.nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.sidebar-nav a,
.nav-link,
.nav-list a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 48px;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
    transition:
        background var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
}

.sidebar-nav a:hover,
.nav-link:hover,
.nav-list a:hover {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    transform: translateX(2px);
}

.sidebar-nav a.active,
.nav-link.active,
.nav-list a.active {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(214, 40, 40, 0.24);
}

.sidebar-nav a svg,
.nav-link svg,
.nav-list a svg {
    width: 18px;
    height: 18px;
}

.sidebar-status,
.system-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.9rem 1rem;
}

.sidebar-status__dot,
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 0 6px rgba(21, 128, 61, 0.12);
}

.sidebar-status__text strong,
.system-status strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-main);
}

.sidebar-status__text span,
.system-status span {
    display: block;
    font-size: 0.82rem;
    color: var(--text-soft);
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.app-topbar__left,
.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.app-topbar__right,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-title-wrap {
    min-width: 0;
}

.page-title,
.topbar-title {
    margin: 0;
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 800;
}

.page-subtitle,
.topbar-subtitle {
    margin: 0.15rem 0 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.page-container,
.content-wrap,
.app-content {
    padding: 1.5rem;
}

/* ==========================================================================
   MOBILE SIDEBAR
   ========================================================================== */

.sidebar-toggle,
.mobile-menu-button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-main);
    display: none;
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    z-index: 35;
}

.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   CARDS / PANELS
   ========================================================================== */

.card,
.panel,
.surface,
.content-card,
.form-card,
.table-card,
.stat-card,
.auth-form-card,
.auth-hero,
.metric-card,
.widget,
.box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.card,
.panel,
.surface,
.content-card,
.form-card,
.table-card,
.metric-card,
.widget,
.box {
    padding: 1.25rem;
}

.card-header,
.panel-header,
.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-title,
.panel-title,
.section-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-subtitle,
.section-subtitle {
    margin-top: 0.3rem;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.section-stack {
    display: grid;
    gap: 1.25rem;
}

/* ==========================================================================
   DASHBOARD STATS
   ========================================================================== */

.stats-grid,
.stat-grid,
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.stat-card,
.metric-card {
    padding: 1.15rem 1.15rem 1rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before,
.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-hover));
}

.stat-card__label,
.metric-label {
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.55rem;
}

.stat-card__value,
.metric-value {
    color: var(--text-main);
    font-size: 1.6rem;
    line-height: 1.15;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.stat-card__meta,
.metric-meta {
    color: var(--text-soft);
    font-size: 0.85rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn,
button,
[type="button"],
[type="submit"],
[type="reset"] {
    border-radius: 999px;
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-primary,
button.btn-primary,
a.btn-primary,
.button-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    color: #fff;
    border-color: var(--brand-primary);
    box-shadow: 0 10px 22px rgba(214, 40, 40, 0.18);
}

.btn-primary:hover,
button.btn-primary:hover,
a.btn-primary:hover,
.button-primary:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-primary-hover) 0%, #991b1b 100%);
    border-color: var(--brand-primary-hover);
}

.btn-secondary,
button.btn-secondary,
a.btn-secondary,
.button-secondary {
    background: #fff;
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-secondary:hover,
button.btn-secondary:hover,
a.btn-secondary:hover,
.button-secondary:hover {
    background: var(--brand-primary-soft);
    color: var(--brand-primary-hover);
}

.btn-outline,
.button-outline {
    background: #fff;
    color: var(--text-main);
    border-color: var(--border-strong);
}

.btn-outline:hover,
.button-outline:hover {
    background: var(--bg-muted);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

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

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover {
    background: #166534;
    color: #fff;
}

.btn-sm {
    min-height: 36px;
    padding: 0.5rem 0.85rem;
    font-size: 0.86rem;
}

.btn-lg {
    min-height: 50px;
    padding: 0.85rem 1.2rem;
    font-size: 1rem;
}

.btn-block,
.w-full {
    width: 100%;
}

/* ==========================================================================
   FORMS
   ========================================================================== */

form {
    margin: 0;
}

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

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

.form-group,
.field,
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

label,
.form-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--text-main);
}

label .required,
.form-label .required,
.required-mark {
    color: var(--brand-primary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="tel"],
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 0.78rem 0.95rem;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--text-main);
    font-size: 0.96rem;
    line-height: 1.45;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast);
}

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

input::placeholder,
textarea::placeholder {
    color: var(--text-faint);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(214, 40, 40, 0.12);
    background: #fff;
}

input[disabled],
select[disabled],
textarea[disabled] {
    background: #f9fafb;
    color: var(--text-faint);
    cursor: not-allowed;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.field-error,
.error-text {
    color: var(--danger);
    font-size: 0.84rem;
    font-weight: 600;
}

.password-wrap,
.password-field {
    position: relative;
}

.password-wrap input,
.password-field input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--text-soft);
    padding: 0.25rem;
    border-radius: 10px;
}

.password-toggle:hover {
    color: var(--brand-primary);
    background: var(--brand-primary-soft);
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-wrap,
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

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

thead th,
.data-table thead th {
    background: var(--brand-primary-soft-2);
    color: var(--brand-secondary);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}

tbody td,
.data-table tbody td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: top;
    font-size: 0.95rem;
}

tbody tr:hover,
.data-table tbody tr:hover {
    background: #fcfcfd;
}

tbody tr:last-child td,
.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.empty-state,
.table-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-soft);
}

/* ==========================================================================
   BADGES / STATUS
   ========================================================================== */

.badge,
.status-chip,
.chip,
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 28px;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-primary,
.status-primary {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    border-color: #f8b4b4;
}

.badge-success,
.status-success {
    background: var(--success-soft);
    color: var(--success);
    border-color: #bbf7d0;
}

.badge-warning,
.status-warning {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: #fde68a;
}

.badge-danger,
.status-danger {
    background: var(--danger-soft);
    color: #991b1b;
    border-color: #fecaca;
}

.badge-info,
.status-info {
    background: var(--info-soft);
    color: var(--info);
    border-color: #bfdbfe;
}

.badge-neutral,
.status-neutral {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #e5e7eb;
}

/* ==========================================================================
   ALERTS / FLASH
   ========================================================================== */

.alert,
.notice,
.flash-message {
    position: relative;
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid transparent;
    margin-bottom: 1rem;
}

.alert strong,
.notice strong,
.flash-message strong {
    display: block;
    margin-bottom: 0.15rem;
    color: inherit;
}

.alert-success {
    background: var(--success-soft);
    color: #166534;
    border-color: #bbf7d0;
}

.alert-danger,
.alert-error {
    background: var(--danger-soft);
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: var(--warning-soft);
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: var(--info-soft);
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.alert-close,
.notice-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: currentColor;
    padding: 0.15rem;
    border-radius: 8px;
}

/* ==========================================================================
   FILTER / TOOLBAR
   ========================================================================== */

.toolbar,
.filters-bar,
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   AUTH / LOGIN
   ========================================================================== */

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at top left, rgba(214, 40, 40, 0.10), transparent 24%),
        radial-gradient(circle at right bottom, rgba(127, 29, 29, 0.10), transparent 22%),
        linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
}

.auth-container {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 1.25rem;
    align-items: stretch;
}

.auth-hero {
    position: relative;
    padding: 2rem;
    overflow: hidden;
    border: 0;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(214, 40, 40, 0.96) 0%, rgba(185, 28, 28, 0.95) 45%, rgba(127, 29, 29, 0.96) 100%);
    box-shadow: var(--shadow-lg);
}

.auth-hero::before {
    content: "";
    position: absolute;
    inset: auto -60px -60px auto;
    width: 220px;
    height: 220px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
}

.auth-hero::after {
    content: "";
    position: absolute;
    inset: 30px auto auto -40px;
    width: 140px;
    height: 140px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.auth-brand__mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(255,255,255,0.18);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.16);
}

.auth-brand__text strong {
    display: block;
    font-size: 1.05rem;
    color: #fff;
}

.auth-brand__text span {
    display: block;
    color: rgba(255,255,255,0.82);
    font-size: 0.88rem;
}

.auth-hero h1 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 0.8rem;
    position: relative;
    z-index: 1;
}

.auth-hero p {
    color: rgba(255,255,255,0.86);
    position: relative;
    z-index: 1;
}

.auth-highlights {
    display: grid;
    gap: 0.85rem;
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

.auth-highlight {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
}

.auth-highlight__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255,255,255,0.12);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.auth-highlight strong {
    display: block;
    color: #fff;
    margin-bottom: 0.1rem;
    font-size: 0.94rem;
}

.auth-highlight span {
    display: block;
    color: rgba(255,255,255,0.78);
    font-size: 0.86rem;
}

.auth-form-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.auth-form-header {
    margin-bottom: 1.25rem;
}

.auth-form-header h2 {
    margin-bottom: 0.4rem;
    font-size: 1.6rem;
}

.auth-form-header p {
    font-size: 0.94rem;
}

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

.auth-footer-note {
    margin-top: 1.35rem;
    text-align: center;
    color: var(--text-soft);
    font-size: 0.86rem;
}

/* ==========================================================================
   LISTS / DETAILS
   ========================================================================== */

.info-list,
.detail-list {
    display: grid;
    gap: 0.8rem;
}

.info-row,
.detail-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px dashed var(--border-color);
}

.info-row:last-child,
.detail-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.info-label,
.detail-label {
    color: var(--text-soft);
    font-weight: 600;
    font-size: 0.92rem;
}

.info-value,
.detail-value {
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.95rem;
    text-align: right;
}

/* ==========================================================================
   CHECKBOX / RADIO
   ========================================================================== */

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--brand-primary);
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.pagination a,
.pagination span {
    min-width: 40px;
    height: 40px;
    padding: 0 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.pagination .active,
.pagination [aria-current="page"] {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

/* ==========================================================================
   MODAL-LIKE / DIALOG SECTIONS
   ========================================================================== */

.modal-card,
.dialog-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 1.4rem;
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.hidden { display: none !important; }
.block { display: block !important; }
.flex { display: flex !important; }
.grid { display: grid !important; }

.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.justify-between { justify-content: space-between !important; }
.justify-end { justify-content: flex-end !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-5 { margin-top: 1.25rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 1.25rem !important; }

.p-0 { padding: 0 !important; }
.p-3 { padding: 0.75rem !important; }
.p-4 { padding: 1rem !important; }

.rounded { border-radius: var(--radius-sm) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }

.bg-white { background: #fff !important; }
.bg-soft { background: var(--bg-muted) !important; }

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal,
.card,
.panel,
.surface,
.content-card,
.stat-card,
.metric-card,
.auth-form-card {
    animation: fadeInUp 0.45s ease both;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1200px) {
    .stats-grid,
    .stat-grid,
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar-toggle,
    .mobile-menu-button {
        display: inline-flex;
    }

    .app-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base);
    }

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

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

    .form-grid,
    .form-grid--3 {
        grid-template-columns: 1fr;
    }

    .app-topbar {
        padding: 0.9rem 1rem;
    }

    .page-container,
    .content-wrap,
    .app-content {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .stats-grid,
    .stat-grid,
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .toolbar,
    .filters-bar,
    .page-toolbar,
    .form-actions,
    .card-header,
    .panel-header,
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-shell {
        padding: 1rem;
    }

    .auth-hero,
    .auth-form-card {
        padding: 1.3rem;
    }

    .auth-hero h1 {
        font-size: 1.6rem;
    }

    .page-title,
    .topbar-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 520px) {
    .btn,
    .btn-sm,
    .btn-lg {
        width: 100%;
    }

    .info-row,
    .detail-row {
        flex-direction: column;
    }

    .info-value,
    .detail-value {
        text-align: left;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   V4 VIEW COMPATIBILITY
   Compatibility with existing factoring Blade views
   ========================================================================== */


/* --------------------------------------------------------------------------
   PAGE HEADING
   -------------------------------------------------------------------------- */

.heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.heading h1 {
    margin: 0.15rem 0 0.35rem;
    font-size: 1.75rem;
    line-height: 1.25;
    color: var(--text-main);
}

.heading h2 {
    margin: 0;
}

.heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.eyebrow {
    color: var(--brand-primary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.muted,
.help {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.help {
    line-height: 1.6;
}


/* --------------------------------------------------------------------------
   LEGACY BUTTON
   -------------------------------------------------------------------------- */

.button,
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    min-height: 44px;

    padding: 0.68rem 1rem;

    border-radius: 999px;

    border: 1px solid var(--brand-primary);

    background:
        linear-gradient(
            135deg,
            var(--brand-primary),
            var(--brand-primary-hover)
        );

    color: #ffffff;

    font-size: 0.92rem;
    font-weight: 700;

    text-decoration: none;

    transition:
        transform 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.button:hover,
a.button:hover {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(214, 40, 40, 0.18);
}

.button.secondary,
a.button.secondary,
button.secondary {
    background: #ffffff;
    color: var(--brand-primary);
    border: 1px solid var(--brand-primary);
}

.button.secondary:hover,
a.button.secondary:hover,
button.secondary:hover {
    background: var(--brand-primary-soft);
    color: var(--brand-primary-hover);
}


/* Generic submit buttons used by V4 views */

form > button[type="submit"]:not(.btn):not(.password-toggle):not(.topbar-logout),
.inline > button,
.funding-fields > button {
    min-height: 44px;

    padding: 0.68rem 1rem;

    border-radius: 999px;

    border: 1px solid var(--brand-primary);

    background:
        linear-gradient(
            135deg,
            var(--brand-primary),
            var(--brand-primary-hover)
        );

    color: #ffffff;

    font-weight: 700;

    cursor: pointer;
}

form > button[type="submit"]:not(.btn):not(.password-toggle):not(.topbar-logout):hover,
.inline > button:hover,
.funding-fields > button:hover {
    background: var(--brand-primary-hover);
}


/* --------------------------------------------------------------------------
   STATS
   -------------------------------------------------------------------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat {
    position: relative;

    overflow: hidden;

    padding: 1.15rem;

    background: #ffffff;

    border: 1px solid var(--border-color);

    border-radius: var(--radius-md);

    box-shadow: var(--shadow-sm);
}

.stat::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 3px;

    background: var(--border-strong);
}

.stat.primary::before {
    background:
        linear-gradient(
            90deg,
            var(--brand-primary),
            var(--brand-primary-hover)
        );
}

.stat .value {
    margin-top: 0.45rem;

    color: var(--text-main);

    font-size: 1.55rem;
    line-height: 1.15;

    font-weight: 800;
}


/* --------------------------------------------------------------------------
   TABLE HELPERS
   -------------------------------------------------------------------------- */

.num {
    text-align: right !important;
}

td small {
    display: block;

    margin-top: 0.25rem;

    color: var(--text-soft);

    font-size: 0.8rem;
}

.empty {
    padding: 2rem 1rem !important;

    text-align: center;

    color: var(--text-soft);
}

.danger-text {
    color: var(--danger) !important;
    font-weight: 700;
}


/* --------------------------------------------------------------------------
   LEGACY BADGE STATES
   -------------------------------------------------------------------------- */

.badge.good {
    background: var(--success-soft);
    color: #166534;
    border-color: #bbf7d0;
}

.badge.bad {
    background: var(--danger-soft);
    color: #991b1b;
    border-color: #fecaca;
}


/* --------------------------------------------------------------------------
   INLINE FORM
   -------------------------------------------------------------------------- */

.inline {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.inline .field {
    min-width: 220px;
    flex: 1;
}


/* --------------------------------------------------------------------------
   GENERIC GRID USED BY FORMS
   -------------------------------------------------------------------------- */

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}


/* --------------------------------------------------------------------------
   PROFILE
   -------------------------------------------------------------------------- */

.profile-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.5fr);
    gap: 1rem;
}

.profile-summary {
    align-self: start;
}

.profile-avatar,
.topbar-avatar {
    width: 48px;
    height: 48px;

    border-radius: 14px;

    display: grid;
    place-items: center;

    background:
        linear-gradient(
            135deg,
            var(--brand-primary),
            var(--brand-primary-hover)
        );

    color: #ffffff;

    font-weight: 800;
}

.profile-summary .profile-avatar {
    width: 68px;
    height: 68px;

    border-radius: 20px;

    margin-bottom: 1rem;

    font-size: 1.3rem;
}

.section-divider {
    margin: 1.5rem 0;

    border: 0;
    border-top: 1px solid var(--border-color);
}

.form-intro {
    margin-top: -0.4rem;
}


/* --------------------------------------------------------------------------
   FUNDING TOOLBAR
   -------------------------------------------------------------------------- */

.funding-toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    padding: 1rem;

    margin-bottom: 1rem;

    border-radius: 16px;

    background: var(--brand-primary-soft-2);

    border: 1px solid #fecaca;
}

.funding-toolbar > div:first-child span {
    display: block;

    margin-top: 0.2rem;

    color: var(--text-soft);

    font-size: 0.88rem;
}

.funding-fields {
    display: grid;

    grid-template-columns:
        minmax(180px, 0.8fr)
        minmax(220px, 1fr)
        auto;

    gap: 0.8rem;

    align-items: end;
}

.select-col {
    width: 64px;
    text-align: center !important;
}


/* --------------------------------------------------------------------------
   TOPBAR USER
   -------------------------------------------------------------------------- */

.topbar-user-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;

    padding: 0.35rem 0.5rem;

    border-radius: 12px;

    color: var(--text-main);

    transition: background 0.18s ease;
}

.topbar-user-link:hover {
    background: var(--bg-muted);
    color: var(--text-main);
}

.topbar-avatar {
    width: 40px;
    height: 40px;

    border-radius: 12px;
}

.topbar-user-copy {
    display: flex;
    flex-direction: column;

    line-height: 1.2;
}

.topbar-user-copy strong {
    max-width: 180px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--text-main);

    font-size: 0.88rem;
}

.topbar-user-copy small {
    max-width: 180px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--text-soft);

    font-size: 0.75rem;
}


/* --------------------------------------------------------------------------
   LOGOUT
   -------------------------------------------------------------------------- */

.topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;

    min-height: 42px;

    padding: 0.55rem 0.8rem;

    border-radius: 999px;

    background: #ffffff;

    border: 1px solid var(--border-color);

    color: var(--text-main);

    font-size: 0.85rem;
    font-weight: 700;
}

.topbar-logout:hover {
    background: var(--brand-primary-soft);

    border-color: #fecaca;

    color: var(--brand-primary);
}


/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */

.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 1rem;

    margin-top: 2rem;

    padding: 1.2rem 0 0.4rem;

    border-top: 1px solid var(--border-color);

    color: var(--text-soft);

    font-size: 0.78rem;
}


/* --------------------------------------------------------------------------
   GLOBAL LOGIN ERROR
   -------------------------------------------------------------------------- */

.auth-global-error {
    position: fixed;

    top: 1rem;
    left: 50%;

    transform: translateX(-50%);

    z-index: 100;

    width: min(560px, calc(100% - 2rem));
}


/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {

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

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

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

    .funding-fields > button {
        grid-column: 1 / -1;
    }

}


@media (max-width: 768px) {

    .heading {
        flex-direction: column;
        align-items: stretch;
    }

    .heading-actions {
        justify-content: stretch;
    }

    .heading-actions .button {
        flex: 1;
    }

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

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

    .inline {
        flex-direction: column;
        align-items: stretch;
    }

    .inline .field {
        width: 100%;
        min-width: 0;
    }

    .funding-fields {
        grid-template-columns: 1fr;
    }

    .funding-fields > button {
        grid-column: auto;
    }

    .topbar-user-copy {
        display: none;
    }

    .logout-text {
        display: none;
    }

    .app-footer {
        flex-direction: column;
        align-items: flex-start;
    }

}

/* ==========================================================================
   ADMIN MANAGEMENT
   ========================================================================== */

.admin-search-form {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.admin-search-input {
    position: relative;
    flex: 1;
}

.admin-search-input svg {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);

    color: var(--text-soft);

    pointer-events: none;
}

.admin-search-input input {
    padding-left: 2.8rem;
}

.search-result-info {
    margin-bottom: 1rem;

    padding: 0.75rem 0.9rem;

    border-radius: 12px;

    background: var(--brand-primary-soft-2);

    border: 1px solid #fecaca;

    color: var(--text-soft);

    font-size: 0.9rem;
}

.search-result-info strong {
    color: var(--brand-primary);
}


.admin-row-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-row-actions form {
    margin: 0;
}


/* ==========================================================================
   ADMIN DETAIL
   ========================================================================== */

.admin-detail-grid {
    display: grid;

    grid-template-columns:
        minmax(300px, 0.9fr)
        minmax(320px, 1.1fr);

    gap: 1rem;
}

.admin-profile-head {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-profile-head .profile-avatar {
    width: 60px;
    height: 60px;

    border-radius: 18px;

    font-size: 1.2rem;
}


@media (max-width: 900px) {

    .admin-detail-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 700px) {

    .admin-search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-row-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-row-actions .btn,
    .admin-row-actions form,
    .admin-row-actions form button {
        width: 100%;
    }

}

/* ==========================================================================
   ADMIN MANAGEMENT - CLEAN EON UI
   ========================================================================== */


/* --------------------------------------------------------------------------
   PAGE HEADER
   -------------------------------------------------------------------------- */

.admin-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 1rem;
}

.admin-page-head h1 {
    margin: 0.2rem 0 0.3rem;

    color: var(--text-main);

    font-size: 1.75rem;
    font-weight: 800;
}

.admin-page-head p {
    margin: 0;

    color: var(--text-soft);

    font-size: 0.92rem;
}


/* --------------------------------------------------------------------------
   SUMMARY - COMPACT
   -------------------------------------------------------------------------- */

.admin-summary-strip {
    display: flex;
    align-items: center;

    gap: 0;

    margin-bottom: 1rem;

    background: #ffffff;

    border: 1px solid var(--border-color);

    border-radius: 16px;

    box-shadow: var(--shadow-sm);
}

.admin-summary-item {
    flex: 1;

    min-height: 82px;

    padding: 1rem 1.15rem;

    display: flex;
    align-items: center;

    gap: 0.85rem;

    border-right: 1px solid var(--border-color);
}

.admin-summary-item:last-child {
    border-right: 0;
}

.admin-summary-item > div {
    display: flex;
    flex-direction: column;
}

.admin-summary-item span:not(.admin-summary-icon) {
    color: var(--text-soft);

    font-size: 0.78rem;
    font-weight: 600;
}

.admin-summary-item strong {
    margin-top: 0.1rem;

    color: var(--text-main);

    font-size: 1.35rem;
    line-height: 1;

    font-weight: 800;
}

.admin-summary-icon {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 12px;
}

.admin-summary-icon--primary {
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
}

.admin-summary-icon--success {
    background: var(--success-soft);
    color: var(--success);
}

.admin-summary-icon--muted {
    background: var(--bg-muted);
    color: var(--text-soft);
}


/* --------------------------------------------------------------------------
   CREATE ADMIN
   -------------------------------------------------------------------------- */

.admin-create-panel {
    margin-bottom: 1rem;

    background: #ffffff;

    border: 1px solid var(--border-color);

    border-radius: 16px;

    box-shadow: var(--shadow-sm);

    overflow: hidden;
}

.admin-create-panel > summary {
    list-style: none;
}

.admin-create-panel > summary::-webkit-details-marker {
    display: none;
}

.admin-create-summary {
    min-height: 72px;

    padding: 0.9rem 1.15rem;

    display: flex;
    align-items: center;
    justify-content: space-between;

    cursor: pointer;

    transition: background 0.18s ease;
}

.admin-create-summary:hover {
    background: #fafafa;
}

.admin-create-summary__left {
    display: flex;
    align-items: center;

    gap: 0.8rem;
}

.admin-create-summary__left > div:last-child {
    display: flex;
    flex-direction: column;
}

.admin-create-summary strong {
    color: var(--text-main);

    font-size: 0.95rem;
    font-weight: 700;
}

.admin-create-summary span:not(.admin-create-plus) {
    margin-top: 0.1rem;

    color: var(--text-soft);

    font-size: 0.8rem;
}

.admin-create-plus {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background: var(--brand-primary);

    color: #ffffff;

    font-size: 1.35rem;
    font-weight: 400;
}

.admin-create-chevron {
    color: var(--text-soft);

    transition: transform 0.2s ease;
}

.admin-create-panel[open] .admin-create-chevron {
    transform: rotate(180deg);
}

.admin-create-body {
    padding: 1rem 1.15rem 1.15rem;

    border-top: 1px solid var(--border-color);

    background: #fcfcfd;
}


/* --------------------------------------------------------------------------
   CREATE FORM
   -------------------------------------------------------------------------- */

.admin-form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0.9rem 1rem;
}

.admin-field {
    display: flex;
    flex-direction: column;

    gap: 0.4rem;
}

.admin-field label {
    margin: 0;

    color: var(--text-main);

    font-size: 0.83rem;
    font-weight: 700;
}

.admin-field label span {
    color: var(--brand-primary);
}

.admin-field input {
    width: 100%;

    min-height: 44px;

    padding: 0.7rem 0.85rem;

    background: #ffffff;

    border: 1px solid var(--border-strong);

    border-radius: 11px;

    color: var(--text-main);

    font-size: 0.9rem;

    box-shadow: none;

    outline: none;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.admin-field input:hover {
    border-color: #b9bec8;
}

.admin-field input:focus {
    border-color: var(--brand-primary);

    box-shadow:
        0 0 0 3px rgba(214, 40, 40, 0.10);
}

.admin-field input::placeholder {
    color: #a4aab4;
}

.admin-field small {
    color: var(--text-soft);

    font-size: 0.76rem;
}

.admin-password-field {
    position: relative;
}

.admin-password-field input {
    padding-right: 2.8rem;
}

.admin-password-toggle {
    position: absolute;

    right: 0.7rem;
    top: 50%;

    transform: translateY(-50%);

    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    padding: 0;

    border: 0;

    border-radius: 8px;

    background: transparent;

    color: var(--text-soft);
}

.admin-password-toggle:hover {
    background: var(--bg-muted);

    color: var(--brand-primary);
}

.admin-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    margin-top: 1rem;

    padding-top: 1rem;

    border-top: 1px solid var(--border-color);
}

.admin-form-hint {
    display: flex;
    align-items: center;

    gap: 0.5rem;

    color: var(--text-soft);

    font-size: 0.8rem;
}

.admin-form-hint svg {
    color: var(--brand-primary);
}


/* --------------------------------------------------------------------------
   LIST CARD
   -------------------------------------------------------------------------- */

.admin-list-card {
    background: #ffffff;

    border: 1px solid var(--border-color);

    border-radius: 16px;

    box-shadow: var(--shadow-sm);

    overflow: hidden;
}

.admin-list-head {
    min-height: 78px;

    padding: 1rem 1.15rem;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    border-bottom: 1px solid var(--border-color);
}

.admin-list-head h2 {
    margin: 0;

    color: var(--text-main);

    font-size: 1rem;
    font-weight: 750;
}

.admin-list-head p {
    margin: 0.15rem 0 0;

    color: var(--text-soft);

    font-size: 0.78rem;
}


/* --------------------------------------------------------------------------
   COMPACT SEARCH
   -------------------------------------------------------------------------- */

.admin-compact-search {
    display: flex;
    align-items: center;

    gap: 0.45rem;
}

.admin-compact-search__input {
    position: relative;

    width: 310px;
}

.admin-compact-search__input svg {
    position: absolute;

    left: 0.75rem;
    top: 50%;

    transform: translateY(-50%);

    color: var(--text-faint);

    pointer-events: none;
}

.admin-compact-search__input input {
    width: 100%;

    min-height: 40px;

    padding:
        0.55rem
        0.8rem
        0.55rem
        2.35rem;

    border: 1px solid var(--border-strong);

    border-radius: 10px;

    background: #ffffff;

    color: var(--text-main);

    font-size: 0.84rem;

    box-shadow: none;
}

.admin-compact-search__input input:focus {
    outline: none;

    border-color: var(--brand-primary);

    box-shadow:
        0 0 0 3px rgba(214, 40, 40, 0.09);
}

.admin-search-button {
    min-height: 40px;

    padding: 0.55rem 0.9rem;

    border: 0;

    border-radius: 10px;

    background: var(--brand-primary);

    color: #ffffff;

    font-size: 0.82rem;
    font-weight: 700;
}

.admin-search-button:hover {
    background: var(--brand-primary-hover);
}

.admin-search-reset {
    min-height: 40px;

    padding: 0.55rem 0.75rem;

    display: inline-flex;
    align-items: center;

    color: var(--text-soft);

    font-size: 0.8rem;
    font-weight: 600;
}

.admin-search-reset:hover {
    color: var(--brand-primary);
}

.admin-search-feedback {
    padding: 0.65rem 1.15rem;

    background: var(--brand-primary-soft-2);

    border-bottom: 1px solid #fee2e2;

    color: var(--text-soft);

    font-size: 0.8rem;
}

.admin-search-feedback strong {
    color: var(--brand-primary);
}


/* --------------------------------------------------------------------------
   TABLE
   -------------------------------------------------------------------------- */

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;

    border-collapse: collapse;

    background: #ffffff;
}

.admin-table thead th {
    padding: 0.75rem 1rem;

    background: #fafafa;

    border-bottom: 1px solid var(--border-color);

    color: #6b7280;

    font-size: 0.7rem;
    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.045em;

    text-align: left;
}

.admin-table tbody td {
    padding: 0.85rem 1rem;

    border-bottom: 1px solid #edf0f3;

    color: var(--text-main);

    font-size: 0.86rem;

    vertical-align: middle;
}

.admin-table tbody tr {
    transition: background 0.15s ease;
}

.admin-table tbody tr:hover {
    background: #fcfcfd;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-id {
    color: var(--text-soft);

    font-size: 0.8rem;
    font-weight: 600;
}


/* --------------------------------------------------------------------------
   ADMIN IDENTITY
   -------------------------------------------------------------------------- */

.admin-identity {
    display: flex;
    align-items: center;

    gap: 0.7rem;
}

.admin-mini-avatar {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border-radius: 11px;

    background: var(--brand-primary-soft);

    color: var(--brand-primary);

    font-size: 0.8rem;
    font-weight: 800;
}

.admin-identity > div:last-child {
    display: flex;
    flex-direction: column;
}

.admin-identity strong {
    color: var(--text-main);

    font-size: 0.86rem;
    font-weight: 700;
}

.admin-identity span {
    margin-top: 0.05rem;

    color: var(--text-soft);

    font-size: 0.72rem;
}

.admin-email {
    color: var(--text-main);

    font-size: 0.84rem;
}

.admin-email:hover {
    color: var(--brand-primary);
}


/* --------------------------------------------------------------------------
   STATUS
   -------------------------------------------------------------------------- */

.admin-status {
    display: inline-flex;
    align-items: center;

    gap: 0.4rem;

    min-height: 27px;

    padding: 0.25rem 0.6rem;

    border-radius: 999px;

    font-size: 0.72rem;
    font-weight: 700;
}

.admin-status i {
    width: 6px;
    height: 6px;

    border-radius: 999px;

    background: currentColor;
}

.admin-status--active {
    background: #ecfdf3;
    color: #15803d;
}

.admin-status--inactive {
    background: #f3f4f6;
    color: #6b7280;
}


/* --------------------------------------------------------------------------
   CREATED DATE
   -------------------------------------------------------------------------- */

.admin-created {
    display: flex;
    flex-direction: column;
}

.admin-created strong {
    color: var(--text-main);

    font-size: 0.82rem;
}

.admin-created span {
    margin-top: 0.08rem;

    color: var(--text-soft);

    font-size: 0.7rem;
}


/* --------------------------------------------------------------------------
   ACTIONS
   -------------------------------------------------------------------------- */

.admin-table-actions-col {
    width: 190px;
}

.admin-action-menu {
    display: flex;
    align-items: center;

    gap: 0.4rem;
}

.admin-action-menu form {
    margin: 0;
}

.admin-action-detail,
.admin-action-toggle {
    min-height: 34px;

    padding: 0.4rem 0.65rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    font-size: 0.74rem;
    font-weight: 700;

    white-space: nowrap;
}

.admin-action-detail {
    background: #ffffff;

    color: var(--brand-primary);

    border: 1px solid #f4a5a5;
}

.admin-action-detail:hover {
    background: var(--brand-primary-soft);

    color: var(--brand-primary-hover);
}

.admin-action-toggle {
    border: 0;

    cursor: pointer;
}

.admin-action-toggle--danger {
    background: #fff1f2;

    color: #b91c1c;
}

.admin-action-toggle--danger:hover {
    background: #fee2e2;
}

.admin-action-toggle--success {
    background: #ecfdf3;

    color: #15803d;
}

.admin-action-toggle--success:hover {
    background: #dcfce7;
}


/* --------------------------------------------------------------------------
   EMPTY STATE
   -------------------------------------------------------------------------- */

.admin-empty {
    min-height: 190px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
}

.admin-empty-icon {
    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    margin-bottom: 0.6rem;

    border-radius: 14px;

    background: var(--bg-muted);

    color: var(--text-soft);

    font-weight: 800;
}

.admin-empty strong {
    color: var(--text-main);
}

.admin-empty span {
    margin-top: 0.2rem;

    color: var(--text-soft);

    font-size: 0.8rem;
}


/* --------------------------------------------------------------------------
   PAGINATION
   -------------------------------------------------------------------------- */

.admin-pagination {
    min-height: 56px;

    padding: 0.75rem 1rem;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-top: 1px solid var(--border-color);

    color: var(--text-soft);

    font-size: 0.78rem;
}

.admin-pagination > div {
    display: flex;

    gap: 0.4rem;
}

.admin-pagination a {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border-color);

    border-radius: 9px;

    background: #ffffff;

    color: var(--text-main);
}

.admin-pagination a:hover {
    border-color: var(--brand-primary);

    color: var(--brand-primary);
}


/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {

    .admin-list-head {
        align-items: flex-start;

        flex-direction: column;
    }

    .admin-compact-search {
        width: 100%;
    }

    .admin-compact-search__input {
        flex: 1;
        width: auto;
    }

}


@media (max-width: 700px) {

    .admin-summary-strip {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-summary-item {
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .admin-summary-item:last-child {
        border-bottom: 0;
    }

    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-form-footer {
        align-items: stretch;

        flex-direction: column;
    }

    .admin-form-footer .btn {
        width: 100%;
    }

    .admin-compact-search {
        align-items: stretch;

        flex-direction: column;
    }

    .admin-compact-search__input {
        width: 100%;
    }

    .admin-search-button {
        width: 100%;
    }

}


/* ================================================================
   VENDOR CONTEXT SWITCHER
   ================================================================ */

.layout-vendor-context {
    margin: 12px;
    padding: 10px;

    border: 1px solid #dbeafe;
    border-radius: 12px;

    background: #f8fbff;
}

.layout-vendor-label {
    margin-bottom: 6px;

    color: #94a3b8;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: .06em;
}

.layout-vendor-switcher {
    position: relative;
}

.layout-vendor-switcher > summary {
    min-height: 42px;

    padding: 7px 9px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    border-radius: 9px;

    background: #ffffff;

    cursor: pointer;

    list-style: none;
}

.layout-vendor-switcher > summary::-webkit-details-marker {
    display: none;
}

.layout-vendor-switcher > summary > div {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.layout-vendor-switcher > summary strong {
    overflow: hidden;

    color: #172033;

    font-size: 10.5px;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.layout-vendor-switcher > summary span {
    color: #94a3b8;

    font-size: 9px;
}

.layout-vendor-menu {
    position: absolute;

    z-index: 50;

    left: 0;
    right: 0;

    top: calc(100% + 6px);

    padding: 6px;

    border: 1px solid #dbeafe;
    border-radius: 10px;

    background: #ffffff;

    box-shadow:
        0 12px 30px rgba(30, 64, 175, .12);
}

.layout-vendor-menu form {
    margin: 0;
}

.layout-vendor-menu button,
.layout-vendor-menu > a {
    width: 100%;

    min-height: 38px;

    padding: 7px 8px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border: 0;
    border-radius: 8px;

    background: transparent;

    color: #344054;

    font-size: 10px;

    cursor: pointer;

    text-align: left;
}

.layout-vendor-menu button:hover,
.layout-vendor-menu > a:hover {
    background: #eff6ff;

    color: #2563eb;
}

.layout-vendor-menu button span {
    display: flex;
    flex-direction: column;
}

.layout-vendor-menu button small {
    margin-top: 1px;

    color: #94a3b8;

    font-size: 8.5px;
}

.layout-vendor-menu > a {
    margin-top: 4px;

    border-top: 1px solid #eff3f8;

    color: #2563eb;

    font-weight: 700;
}

.layout-vendor-empty {
    min-height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: #dbeafe;

    color: #2563eb;

    font-size: 10px;
    font-weight: 700;
}
