/* =============================================================================
   ProduceTrace Admin Portal — "Command Center" Theme
   Blazor WASM + Bootstrap 5.3.3 Override Layer
   ============================================================================= */

/* Wide-table top scrollbar — paired with the JS in index.html. */
.top-scrollbar-bar {
    overflow-x: auto;
    overflow-y: hidden;
    height: 12px;
    margin-bottom: 2px;
}
.top-scrollbar-inner { height: 1px; }
.top-scrollbar-bar::-webkit-scrollbar { height: 12px; }
.top-scrollbar-bar::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 6px;
}
.top-scrollbar-bar::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}
.top-scrollbar-bar::-webkit-scrollbar-track { background: transparent; }


/* ---------------------------------------------------------------------------
   1. Design Tokens (CSS Custom Properties)
   --------------------------------------------------------------------------- */
:root {
    /* Sidebar */
    --pt-sidebar-bg: #0c0a20;
    --pt-sidebar-hover: rgba(255,255,255,0.05);
    --pt-sidebar-active: rgba(99,102,241,0.15);
    --pt-sidebar-accent: #818cf8;
    --pt-sidebar-text: rgba(255,255,255,0.6);
    --pt-sidebar-text-active: #ffffff;
    --pt-sidebar-section: rgba(255,255,255,0.3);

    /* Brand / Primary */
    --pt-primary: #6366f1;
    --pt-primary-hover: #4f46e5;
    --pt-primary-light: rgba(99,102,241,0.1);

    /* Surfaces */
    --pt-bg: #f1f5f9;
    --pt-card-bg: #ffffff;

    /* Text */
    --pt-text: #1e293b;
    --pt-text-muted: #64748b;

    /* Borders & Elevation */
    --pt-border: #e2e8f0;
    --pt-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --pt-shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.03);
    --pt-shadow-lg: 0 10px 25px rgba(0,0,0,0.08);

    /* Semantic */
    --pt-success: #10b981;
    --pt-warning: #f59e0b;
    --pt-danger: #ef4444;
    --pt-info: #3b82f6;

    /* Radii */
    --pt-radius: 12px;
    --pt-radius-sm: 8px;

    /* Motion */
    --pt-transition: 200ms ease;

    /* Layout Dimensions */
    --sidebar-width: 260px;
    --topbar-height: 60px;
}

/* ---------------------------------------------------------------------------
   2. Base / Reset
   --------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------------------------------------------------------------------------
   3. Typography
   --------------------------------------------------------------------------- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-size: 0.9375rem;
    color: var(--pt-text);
    background: var(--pt-bg);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--pt-text);
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: 0.95rem; }
h6 { font-size: 0.85rem; }

.text-muted {
    color: var(--pt-text-muted) !important;
}

/* ---------------------------------------------------------------------------
   4. App Layout Shell
   --------------------------------------------------------------------------- */
.app-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--pt-bg);
    min-width: 0;
}

.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

/* ---------------------------------------------------------------------------
   5. Sidebar
   --------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--pt-sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
}

.sidebar-brand {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--pt-sidebar-accent);
}

.sidebar-brand span {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #fff;
}

.sidebar-version {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 500;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    padding: 0.1em 0.5em;
    border-radius: 4px;
    margin-left: 0.35rem;
    vertical-align: middle;
    letter-spacing: 0.03em;
}

.nav-section-header {
    text-transform: uppercase;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--pt-sidebar-section);
    padding: 0.5rem 1.25rem 0.35rem;
    margin-top: 1rem;
    user-select: none;
}

.sidebar .nav-link {
    color: var(--pt-sidebar-text);
    padding: 0.55rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    border-left: 3px solid transparent;
    transition: all var(--pt-transition);
    position: relative;
    white-space: nowrap;
}

.sidebar .nav-link:hover {
    color: rgba(255,255,255,0.9);
    background: var(--pt-sidebar-hover);
}

.sidebar .nav-link.active {
    color: var(--pt-sidebar-text-active);
    background: var(--pt-sidebar-active);
    border-left-color: var(--pt-sidebar-accent);
    font-weight: 600;
}

.sidebar .nav-link i {
    font-size: 1.05rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.45);
    padding: 0.15em 0.55em;
    border-radius: 4px;
    margin-left: auto;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---------------------------------------------------------------------------
   6. Topbar
   --------------------------------------------------------------------------- */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    flex-shrink: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--pt-text);
}

.topbar-breadcrumb {
    font-size: 0.8rem;
    color: var(--pt-text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-notification {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--pt-text-muted);
    cursor: pointer;
    transition: background var(--pt-transition);
    font-size: 1.1rem;
}

.topbar-notification:hover {
    background: var(--pt-bg);
    color: var(--pt-text);
}

.topbar-notification .notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--pt-danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--pt-radius-sm);
    transition: background var(--pt-transition);
}

.topbar-user:hover {
    background: var(--pt-bg);
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.topbar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--pt-text);
}

.topbar-user-role {
    font-size: 0.7rem;
    color: var(--pt-text-muted);
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--pt-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   7. Cards
   --------------------------------------------------------------------------- */
.card {
    background: var(--pt-card-bg);
    border: 1px solid var(--pt-border);
    border-radius: var(--pt-radius);
    box-shadow: var(--pt-shadow);
    transition: box-shadow var(--pt-transition);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--pt-border);
    font-weight: 600;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: #fff;
    border-top: 1px solid var(--pt-border);
    padding: 0.75rem 1.25rem;
}

/* ---------------------------------------------------------------------------
   8. Stat Cards
   --------------------------------------------------------------------------- */
.stat-card {
    border-left: 4px solid var(--pt-border);
    border-radius: var(--pt-radius);
    background: var(--pt-card-bg);
    box-shadow: var(--pt-shadow);
    padding: 1.25rem;
    transition: box-shadow var(--pt-transition), transform var(--pt-transition);
}

.stat-card:hover {
    box-shadow: var(--pt-shadow-md);
    transform: translateY(-1px);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.25rem;
    flex-shrink: 0;
}

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

.stat-card-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pt-text-muted);
    font-weight: 500;
}

.stat-card-change {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Stat Card Color Variants — Indigo palette */
.stat-card-teal {
    border-left-color: var(--pt-primary);
}
.stat-card-teal .stat-card-icon {
    background: rgba(99,102,241,0.1);
    color: #6366f1;
}

.stat-card-emerald {
    border-left-color: #10b981;
}
.stat-card-emerald .stat-card-icon {
    background: rgba(16,185,129,0.1);
    color: #10b981;
}

.stat-card-amber {
    border-left-color: #f59e0b;
}
.stat-card-amber .stat-card-icon {
    background: rgba(245,158,11,0.1);
    color: #f59e0b;
}

.stat-card-rose {
    border-left-color: #ef4444;
}
.stat-card-rose .stat-card-icon {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
}

/* ---------------------------------------------------------------------------
   9. Tables
   --------------------------------------------------------------------------- */
.table-wrapper {
    border-radius: var(--pt-radius);
    overflow: hidden;
    border: 1px solid var(--pt-border);
    background: var(--pt-card-bg);
}

.table-wrapper .table {
    margin: 0;
}

.table thead th {
    background: #f8fafc;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--pt-text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--pt-border);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
    border-color: var(--pt-border);
    color: var(--pt-text);
}

.table-hover tbody tr:hover {
    background: rgba(99,102,241,0.03);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(241,245,249,0.5);
}

/* ---------------------------------------------------------------------------
   10. Modals
   --------------------------------------------------------------------------- */
/* z-index ladder: sidebar < topbar(50) < backdrop(1065) < modal(1070) */
.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1065 !important;
}

.modal.show,
.modal.d-block {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1070 !important;
    overflow-x: hidden;
    overflow-y: auto;
}

.modal.show .modal-dialog,
.modal.d-block .modal-dialog {
    margin: 1.75rem auto !important;
    max-height: calc(100vh - 3.5rem);
}

.modal-content {
    border-radius: var(--pt-radius);
    border: none;
    box-shadow: var(--pt-shadow-lg);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--pt-border);
    padding: 1rem 1.25rem;
    background: #fff;
}

.modal-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--pt-text);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--pt-border);
    padding: 0.75rem 1.25rem;
    background: #fff;
}

.modal-backdrop {
    background: rgba(12,10,32,0.4);
}

.modal-backdrop.show {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ---------------------------------------------------------------------------
   11. Forms
   --------------------------------------------------------------------------- */
.form-control {
    border-radius: var(--pt-radius-sm);
    border-color: var(--pt-border);
    transition: border-color var(--pt-transition), box-shadow var(--pt-transition);
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    color: var(--pt-text);
}

.form-control:focus {
    border-color: var(--pt-primary);
    box-shadow: 0 0 0 3px var(--pt-primary-light);
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--pt-text);
    margin-bottom: 0.35rem;
}

.form-select {
    border-radius: var(--pt-radius-sm);
    border-color: var(--pt-border);
    transition: border-color var(--pt-transition), box-shadow var(--pt-transition);
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    color: var(--pt-text);
}

.form-select:focus {
    border-color: var(--pt-primary);
    box-shadow: 0 0 0 3px var(--pt-primary-light);
}

.form-text {
    font-size: 0.8rem;
    color: var(--pt-text-muted);
}

.input-group-text {
    background: #f8fafc;
    border-color: var(--pt-border);
    font-size: 0.875rem;
    color: var(--pt-text-muted);
}

.form-check-input:checked {
    background-color: var(--pt-primary);
    border-color: var(--pt-primary);
}

.form-check-input:focus {
    border-color: var(--pt-primary);
    box-shadow: 0 0 0 3px var(--pt-primary-light);
}

.form-switch .form-check-input:checked {
    background-color: var(--pt-primary);
    border-color: var(--pt-primary);
}

/* Validation States */
.valid.modified:not([type=checkbox]) {
    outline: none;
    border-color: var(--pt-success);
}

.invalid {
    outline: none;
    border-color: var(--pt-danger) !important;
}

.validation-message {
    color: var(--pt-danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ---------------------------------------------------------------------------
   12. Buttons
   --------------------------------------------------------------------------- */
.btn {
    border-radius: var(--pt-radius-sm);
    font-weight: 500;
    transition: all var(--pt-transition);
    font-size: 0.875rem;
    padding: 0.45rem 1rem;
}

.btn-primary {
    background-color: var(--pt-primary) !important;
    border-color: var(--pt-primary) !important;
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--pt-primary-hover) !important;
    border-color: var(--pt-primary-hover) !important;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
    color: #fff;
}

.btn-primary:active {
    background-color: var(--pt-primary-hover) !important;
    border-color: var(--pt-primary-hover) !important;
}

.btn-outline-primary {
    color: var(--pt-primary) !important;
    border-color: var(--pt-primary) !important;
    background: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--pt-primary) !important;
    border-color: var(--pt-primary) !important;
    color: #fff !important;
}

.btn-success {
    background-color: var(--pt-success) !important;
    border-color: var(--pt-success) !important;
}

.btn-success:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
    box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}

.btn-danger {
    background-color: var(--pt-danger) !important;
    border-color: var(--pt-danger) !important;
}

.btn-danger:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    box-shadow: 0 2px 8px rgba(239,68,68,0.3);
}

.btn-warning {
    background-color: var(--pt-warning) !important;
    border-color: var(--pt-warning) !important;
    color: #fff;
}

.btn-warning:hover {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
    color: #fff;
}

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

.btn-outline-secondary:hover {
    background: var(--pt-bg);
    border-color: var(--pt-border);
    color: var(--pt-text);
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--pt-radius);
}

/* ---------------------------------------------------------------------------
   13. Badges
   --------------------------------------------------------------------------- */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    border-radius: 6px;
    padding: 0.3em 0.65em;
}

.badge-soft-success {
    background: rgba(16,185,129,0.1) !important;
    color: #059669 !important;
}

.badge-soft-warning {
    background: rgba(245,158,11,0.1) !important;
    color: #d97706 !important;
}

.badge-soft-danger {
    background: rgba(239,68,68,0.1) !important;
    color: #dc2626 !important;
}

.badge-soft-info {
    background: rgba(59,130,246,0.1) !important;
    color: #2563eb !important;
}

.badge-soft-primary {
    background: var(--pt-primary-light) !important;
    color: var(--pt-primary) !important;
}

.badge-soft-secondary {
    background: rgba(108,117,125,0.1) !important;
    color: #495057 !important;
}

.bg-success {
    background-color: var(--pt-success) !important;
}

.bg-warning {
    background-color: var(--pt-warning) !important;
}

.bg-danger {
    background-color: var(--pt-danger) !important;
}

.bg-info {
    background-color: var(--pt-info) !important;
}

/* ---------------------------------------------------------------------------
   14. Alerts
   --------------------------------------------------------------------------- */
.alert {
    border-radius: var(--pt-radius-sm);
    border: 1px solid transparent;
    border-left: 4px solid transparent;
    font-size: 0.875rem;
    padding: 0.85rem 1.1rem;
}

.alert-success {
    background: rgba(16,185,129,0.08);
    border-left-color: var(--pt-success);
    color: #065f46;
}

.alert-danger {
    background: rgba(239,68,68,0.08);
    border-left-color: var(--pt-danger);
    color: #991b1b;
}

.alert-warning {
    background: rgba(245,158,11,0.08);
    border-left-color: var(--pt-warning);
    color: #92400e;
}

.alert-info {
    background: rgba(59,130,246,0.08);
    border-left-color: var(--pt-info);
    color: #1e40af;
}

/* ---------------------------------------------------------------------------
   15. Tabs
   --------------------------------------------------------------------------- */
.nav-tabs {
    border-bottom: 2px solid var(--pt-border);
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.65rem 1.25rem;
    font-weight: 500;
    color: var(--pt-text-muted);
    margin-bottom: -2px;
    transition: color var(--pt-transition), border-color var(--pt-transition);
    font-size: 0.875rem;
}

.nav-tabs .nav-link.active {
    color: var(--pt-primary);
    border-bottom-color: var(--pt-primary);
    font-weight: 600;
    background: transparent;
}

.nav-tabs .nav-link:hover:not(.active) {
    color: var(--pt-text);
    border-bottom-color: var(--pt-border);
    background: transparent;
}

.tab-content {
    padding-top: 1.25rem;
}

/* ---------------------------------------------------------------------------
   16. Pagination
   --------------------------------------------------------------------------- */
.pagination {
    gap: 2px;
}

.page-link {
    border-radius: var(--pt-radius-sm);
    margin: 0 2px;
    border-color: var(--pt-border);
    color: var(--pt-text);
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    transition: all var(--pt-transition);
}

.page-link:hover {
    background: var(--pt-bg);
    border-color: var(--pt-border);
    color: var(--pt-primary);
}

.page-item.active .page-link {
    background-color: var(--pt-primary);
    border-color: var(--pt-primary);
    color: #fff;
}

.page-item.disabled .page-link {
    color: #cbd5e1;
    background: transparent;
}

/* ---------------------------------------------------------------------------
   17. Loading & Skeleton States
   --------------------------------------------------------------------------- */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--pt-radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.spinner-border {
    color: var(--pt-primary);
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--pt-radius);
}

/* ---------------------------------------------------------------------------
   18. Login Page
   --------------------------------------------------------------------------- */
.login-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.login-brand-panel {
    flex: 0 0 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    background: linear-gradient(135deg, #0c0a20 0%, #312e81 50%, #4f46e5 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    pointer-events: none;
}

.login-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}

.login-brand-panel h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.login-brand-panel .tagline {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-top: 0.5rem;
    position: relative;
    z-index: 1;
    font-weight: 400;
}

.login-features {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.login-features li {
    padding: 0.5rem 0;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.95rem;
    opacity: 0.9;
}

.login-features li i {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.12);
    border-radius: 8px;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 3rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.login-card .login-subtitle {
    color: var(--pt-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.login-card .btn-primary {
    width: 100%;
    padding: 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .login-brand-panel {
        display: none;
    }
    .login-form-panel {
        flex: 1;
        padding: 2rem 1.5rem;
    }
}

/* ---------------------------------------------------------------------------
   Tablet fix (Aug 2026): tables with Actions columns were getting clipped
   on Android tablets because .page-content is overflow-x:hidden. Wrap every
   table in the page area so it scrolls horizontally on tablet/phone widths,
   surfacing the right-side action buttons via a swipe.
   Also use dvh (dynamic viewport height) so the mobile browser chrome
   showing/hiding doesn't clip the bottom of the app.
   --------------------------------------------------------------------------- */
@media (max-width: 1440px) {
    .app-wrapper {
        height: 100dvh;
    }
    .page-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Every card body auto-scrolls horizontally so wide tables never chop
       their right-side Action columns off. Wrapper-based overflow preserves
       table row rendering across all browsers. */
    .page-content .card-body {
        overflow-x: auto;
    }
    .page-content .table {
        min-width: max-content;
    }
}

/* ---------------------------------------------------------------------------
   19. Coming Soon Placeholder
   --------------------------------------------------------------------------- */
.coming-soon {
    text-align: center;
    padding: 4rem 2rem;
}

.coming-soon-icon {
    font-size: 4rem;
    color: var(--pt-text-muted);
    opacity: 0.3;
}

.coming-soon-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1rem;
    color: var(--pt-text);
}

.coming-soon-text {
    color: var(--pt-text-muted);
    max-width: 400px;
    margin: 0.5rem auto 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ---------------------------------------------------------------------------
   20. Custom Scrollbar
   --------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Sidebar scrollbar override */
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

/* ---------------------------------------------------------------------------
   21. Animations & Utilities
   --------------------------------------------------------------------------- */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Bootstrap Utility Overrides */
.text-primary {
    color: var(--pt-primary) !important;
}

.bg-primary {
    background-color: var(--pt-primary) !important;
}

.border-primary {
    border-color: var(--pt-primary) !important;
}

.link-primary {
    color: var(--pt-primary) !important;
}

.link-primary:hover {
    color: var(--pt-primary-hover) !important;
}

/* Dropdown overrides */
.dropdown-menu {
    border-radius: var(--pt-radius-sm);
    border-color: var(--pt-border);
    box-shadow: var(--pt-shadow-md);
    padding: 0.35rem;
    font-size: 0.875rem;
}

.dropdown-item {
    border-radius: 6px;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    transition: background var(--pt-transition);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--pt-bg);
    color: var(--pt-text);
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--pt-primary-light);
    color: var(--pt-primary);
}

.dropdown-divider {
    border-color: var(--pt-border);
    margin: 0.25rem 0;
}

/* Tooltip override */
.tooltip-inner {
    background: var(--pt-text);
    border-radius: 6px;
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
    font-family: 'Inter', sans-serif;
}

/* Progress bar overrides */
.progress {
    border-radius: var(--pt-radius-sm);
    background: var(--pt-bg);
    height: 6px;
}

.progress-bar {
    background-color: var(--pt-primary);
    border-radius: var(--pt-radius-sm);
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 0;
    font-size: 0.8rem;
}

.breadcrumb-item a {
    color: var(--pt-text-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--pt-primary);
}

.breadcrumb-item.active {
    color: var(--pt-text);
}

/* List group */
.list-group-item {
    border-color: var(--pt-border);
    padding: 0.75rem 1.1rem;
    font-size: 0.875rem;
}

.list-group-item.active {
    background-color: var(--pt-primary);
    border-color: var(--pt-primary);
}

/* Offcanvas */
.offcanvas {
    border-color: var(--pt-border);
}

.offcanvas-header {
    border-bottom: 1px solid var(--pt-border);
    padding: 1rem 1.25rem;
}

.offcanvas-title {
    font-weight: 600;
    font-size: 1.05rem;
}

/* Popover */
.popover {
    border-radius: var(--pt-radius-sm);
    border-color: var(--pt-border);
    box-shadow: var(--pt-shadow-md);
}

/* ---------------------------------------------------------------------------
   22. Blazor Infrastructure
   --------------------------------------------------------------------------- */
#blazor-error-ui {
    display: none;
}

/* Blazor reconnection UI */
#components-reconnect-modal {
    z-index: 10000;
}

/* ---------------------------------------------------------------------------
   23. Print Styles
   --------------------------------------------------------------------------- */
@media print {
    .sidebar,
    .topbar,
    .no-print {
        display: none !important;
    }
    .main-area {
        margin: 0;
    }
    .page-content {
        padding: 0;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ---------------------------------------------------------------------------
   Searchable Select — Select2-style searchable dropdown component
   --------------------------------------------------------------------------- */

.ss-container {
    position: relative;
    width: 100%;
}

.ss-input {
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    padding-right: 2rem !important;
}

.ss-container.ss-open .ss-input {
    cursor: text;
    border-color: var(--admin-primary, #6366f1);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);
}

.ss-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1080;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    max-height: 220px;
    overflow-y: auto;
    margin-top: 2px;
    padding: 4px 0;
}

.ss-item {
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ss-item:hover,
.ss-item.ss-hl {
    background: rgba(99, 102, 241, 0.08);
}

.ss-item.ss-active {
    background: var(--admin-primary, #6366f1);
    color: #fff;
    font-weight: 500;
}

.ss-item.ss-active.ss-hl {
    background: #4f46e5;
    color: #fff;
}

.ss-item.ss-none {
    color: #94a3b8;
    font-style: italic;
    cursor: default;
    text-align: center;
    padding: 12px;
}

.ss-item.ss-none:hover {
    background: transparent;
}

.ss-match {
    color: var(--admin-primary, #6366f1);
    font-weight: 600;
}

.ss-item.ss-active .ss-match {
    color: #fff;
}

.ss-dropdown::-webkit-scrollbar {
    width: 6px;
}

.ss-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.ss-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.modal .ss-dropdown {
    z-index: 1090;
}
