/* ============================================
   DST Customer Client — Modern Design System
   Inspired by PanelDistribuidor.html
   ============================================ */

:root {
    --bg-body: #f4f7fb;
    --bg-card: #ffffff;
    --bg-card-hover: rgba(59,130,246,0.04);
    --border-card: rgba(0,0,0,0.08);
    --border-card-hover: rgba(59,130,246,0.3);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59,130,246,0.1);
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 4px 24px rgba(0,0,0,0.06);
    --shadow-card-hover: 0 4px 32px rgba(59,130,246,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --sidebar-width: 260px;
}

/* ---- Base ---- */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

/* ---- Legacy DST color theme (redefined) ---- */

.bg-blue-dst {
    background-color: var(--bg-body) !important;
}

.bg-light-cyan-dst {
    background-color: var(--accent-light);
}

.bg-cyan-dst {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
}

.bg-dark-cyan-dst {
    background-color: #dbeafe;
}

.bg-dark-red-dst {
    background-color: #fecaca;
}

.bg-light-gray-dst {
    background-color: #f8fafc;
}

.fg-light-cyan-dst {
    color: var(--text-muted);
}

.fg-cyan-dst {
    color: var(--accent);
}

.fg-dark-cyan-dst {
    color: var(--accent-hover);
}

.fg-light-red-dst {
    color: var(--danger);
}

.fg-blue-dst {
    color: var(--accent);
}

/* ---- Cards & Containers ---- */

.bordered-object-dst {
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    background: var(--bg-card);
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.bordered-object-dst:hover {
    border-color: var(--border-card-hover);
    box-shadow: var(--shadow-card-hover);
}

.shaded-button-dst {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: var(--radius-sm);
    transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.shaded-button-dst:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

/* ---- DataGrid ---- */

.datagrid-dst th {
    background-color: #f1f5f9;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 16px;
    border-bottom: 2px solid #e2e8f0;
}

.datagrid-dst td {
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.datagrid-dst tr:hover td {
    background-color: var(--bg-card-hover);
}

.datagrid-dst .table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-sm);
}

/* Ensure Blazorise date/time picker dropdowns are not clipped */
.flatpickr-calendar,
.b-is-autocomplete .dropdown-menu,
.date-picker .dropdown-menu,
.time-picker .dropdown-menu {
    z-index: 1060 !important;
}

.cst-card .cst-card-body {
    overflow: visible;
}

/* Fix select dropdowns inside table headers (Cartes page) */
.table th select option,
.table th .custom-select option,
.table th .form-select option {
    color: #0f172a;
    background: white;
}

/* Fix Blazorise FixedHeader table clipping select dropdowns */
.table-fixed-header {
    overflow: visible !important;
}

.table-fixed-header thead {
    position: relative;
    z-index: 10;
}

.table-fixed-header tbody {
    display: block;
    max-height: 600px;
    overflow-y: auto;
}

.table-fixed-header thead tr,
.table-fixed-header tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

/* ---- Splash / Login Container ---- */

.splash-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    margin: auto;
}

.splash-container .card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.splash-container .card-header {
    padding: 28px 24px;
    text-align: center;
    border-bottom: none;
}

.splash-container .card-body {
    padding: 28px 24px;
}

.splash-description {
    text-align: center;
    display: block;
    line-height: 1.5;
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-top: 4px;
    padding-bottom: 10px;
    font-family: var(--font-body);
}

/* ---- Layout: Sidebar + Main ---- */

.cst-layout {
    display: flex;
    min-height: 100vh;
}

.cst-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.3s var(--ease);
}

.cst-sidebar-logo {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cst-sidebar-logo-img {
    max-width: 120px;
    height: auto;
}

.cst-sidebar-section {
    padding: 16px 12px 8px;
}

.cst-sidebar-section-title {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.cst-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    text-decoration: none;
    margin-bottom: 2px;
}

.cst-sidebar-item:hover {
    background: var(--bg-card-hover);
    color: var(--accent);
    text-decoration: none;
}

.cst-sidebar-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.cst-sidebar-item i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Sidebar Info Panel */

.cst-sb-est-name {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--accent-light);
    border-radius: var(--radius-xs);
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.cst-sb-est-name i {
    flex-shrink: 0;
    font-size: 0.85rem;
}

.cst-sb-est-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cst-sb-info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.cst-sb-info-row i {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-muted);
    margin-top: 2px;
    font-size: 0.75rem;
}

.cst-sb-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.cst-sb-badge i {
    font-size: 0.7rem;
}

.cst-sb-badge-success {
    background: rgba(34,197,94,0.08);
    color: #16a34a;
}

.cst-sb-badge-danger {
    background: rgba(239,68,68,0.08);
    color: #dc2626;
}

.cst-sb-badge-warning {
    background: rgba(245,158,11,0.08);
    color: #d97706;
}

.cst-sb-channels {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cst-sb-channel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.cst-sb-channel.active {
    color: var(--text-secondary);
}

.cst-sb-channel i {
    width: 18px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--accent);
}

.cst-sb-welcome {
    text-align: center;
    padding: 32px 16px 24px;
}

.cst-sb-welcome-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-light), rgba(139,92,246,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.4rem;
    color: var(--accent);
}

.cst-sb-welcome p {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.cst-sb-welcome span {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.cst-sb-empty {
    text-align: center;
    padding: 28px 16px;
}

.cst-sb-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.cst-sb-empty p {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 4px;
}

.cst-sb-empty span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cst-sidebar-spacer {
    flex: 1;
}

.cst-sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    gap: 12px;
}

.cst-sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.cst-sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.cst-sidebar-user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cst-sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cst-sidebar-logout {
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s;
    border: none;
    background: none;
    font-size: 0.95rem;
}

.cst-sidebar-logout:hover {
    color: var(--danger);
    background: rgba(239,68,68,0.08);
}

/* Main area */

.cst-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.cst-topbar {
    height: 64px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.cst-topbar-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.cst-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cst-hamburger {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
}

.cst-hamburger:hover {
    background: var(--bg-card-hover);
}

.cst-content {
    flex: 1;
    padding: 32px;
}

/* ---- Page Header ---- */

.page-header {
    margin-bottom: 28px;
}

.pageheader-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.pageheader-text {
    margin-bottom: 12px;
    display: none;
}

.page-breadcrumb .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin-bottom: 0;
    list-style: none;
    background-color: transparent;
    border-radius: 0;
    border-top: none;
    padding-top: 4px;
    font-size: 0.8rem;
    font-family: var(--font-body);
}

.page-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    display: inline-block;
    padding-right: 0.5rem;
    color: var(--text-muted);
    content: "\f105";
    font-family: 'Font Awesome\ 5 Free';
    font-weight: 600;
    font-size: 0.7rem;
}

.page-breadcrumb .breadcrumb-link {
    color: var(--text-muted);
    transition: color 0.2s;
}

.page-breadcrumb .breadcrumb-link:hover {
    color: var(--accent);
    text-decoration: none;
}

.page-breadcrumb .breadcrumb-item.active {
    color: var(--text-tertiary);
}

/* ---- Header / Navbar (legacy support) ---- */

.dashboard-header .navbar {
    padding: 0;
    border-bottom: 1px solid var(--border-card);
    box-shadow: none;
    min-height: 64px;
    background: var(--bg-card);
}

.navbar-brand {
    display: inline-block;
    margin-right: 1rem;
    line-height: inherit;
    white-space: nowrap;
    padding: 11px 20px;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.navbar-brand:hover {
    color: var(--accent-hover);
}

.user-avatar-md {
    height: 32px;
    width: 32px;
    border-radius: 8px;
}

.navbar-right-top .nav-item {
    border-right: 1px solid var(--border-card);
}

.navbar-right-top .nav-item:last-child {
    border: none;
}

.navbar-right-top .nav-item .nav-link {
    padding: 13px 20px;
    font-size: 0.9rem;
    line-height: 2;
    color: var(--text-secondary);
    font-family: var(--font-body);
}

.nav-user-dropdown {
    padding: 0;
    min-width: 230px;
    margin: 0;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.nav-user-info {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    line-height: 1.5;
    padding: 16px;
    color: #fff;
    font-size: 0.85rem;
    border-radius: 0;
    font-family: var(--font-body);
}

.nav-user-info .status {
    float: left;
    top: 7px;
    left: 0;
}

.nav-user-dropdown .dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 20px;
    clear: both;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    font-family: var(--font-body);
    transition: background 0.15s;
}

.nav-user-dropdown .dropdown-item:hover {
    background-color: var(--bg-card-hover);
    color: var(--accent);
}

/* ---- Spinner ---- */

.dashboard-spinner {
    margin: 0 8px;
    border-radius: 50%;
    background-color: transparent;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--accent);
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.spinner-xxl { width: 150px; height: 150px; }
.spinner-xl { width: 120px; height: 120px; }
.spinner-lg { width: 100px; height: 100px; }
.spinner-md { width: 80px; height: 80px; }
.spinner-sm { width: 60px; height: 60px; }
.spinner-xs { width: 30px; height: 30px; }

.spinner-primary { border-top-color: var(--accent); }
.spinner-secondary { border-top-color: #6c757d; }
.spinner-success { border-top-color: var(--success); }
.spinner-danger { border-top-color: var(--danger); }
.spinner-warning { border-top-color: var(--warning); }
.spinner-info { border-top-color: #0ea5e9; }

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---- Small links ---- */

.small-link {
    color: var(--accent);
    font-size: 0.85rem;
    text-align: center;
    display: block;
    margin: 0 auto;
    transition: color 0.2s;
}

.small-link:hover {
    color: var(--accent-hover);
}

/* ---- Custom Select ---- */

.custom-select {
    display: inline-block;
    width: 100%;
    height: calc(1.5em + .75rem + 2px);
    padding: .375rem 1.75rem .375rem .75rem;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    vertical-align: middle;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xs);
    appearance: none;
    background-color: var(--bg-card);
    font-family: var(--font-body);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    outline: none;
}

/* ---- CST Cards (new) ---- */

.cst-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: visible;
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.cst-card:hover {
    border-color: var(--border-card-hover);
    box-shadow: var(--shadow-card-hover);
}

.cst-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    gap: 12px;
}

.cst-card-header h3, .cst-card-header h4 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
}

.cst-card-body {
    padding: 24px;
}

/* ---- CST Buttons ---- */

.cst-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    text-decoration: none;
    line-height: 1.4;
}

.cst-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.cst-btn-primary {
    background: var(--accent);
    color: white;
}

.cst-btn-primary:hover {
    background: var(--accent-hover);
    color: white;
    box-shadow: 0 4px 16px rgba(59,130,246,0.3);
}

.cst-btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

.cst-btn-outline:hover {
    background: var(--accent-light);
    color: var(--accent-hover);
}

.cst-btn-danger {
    background: var(--danger);
    color: white;
}

.cst-btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 16px rgba(239,68,68,0.3);
}

/* ---- Dashboard Cards ---- */

.cst-est-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    text-decoration: none;
    color: var(--text-primary);
}

.cst-est-card:hover {
    border-color: var(--border-card-hover);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text-primary);
}

.cst-est-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.cst-est-card-info {
    flex: 1;
    min-width: 0;
}

.cst-est-card-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cst-est-card-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: transform 0.2s;
}

.cst-est-card:hover .cst-est-card-arrow {
    transform: translateX(4px);
    color: var(--accent);
}

/* Feature / Quick Action Cards */

.cst-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.cst-feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    text-decoration: none;
    color: var(--text-primary);
}

.cst-feature-card:hover {
    border-color: var(--border-card-hover);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
    text-decoration: none;
    color: var(--text-primary);
}

.cst-feature-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.cst-feature-card-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ---- API Key Badge ---- */

.cst-apikey {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cst-apikey-copy {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.cst-apikey-copy:hover {
    background: var(--accent-light);
}

/* ---- Forms inside cards ---- */

.cst-content .form-control,
.cst-content .form-control:not(.is-invalid) {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 10px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text-primary);
}

.cst-content .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    outline: none;
}

.cst-content label:not(.custom-control-label) {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-family: var(--font-body);
}

/* ---- Blazorise Overrides ---- */

.cst-content .card {
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.cst-content .card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-card);
    font-family: var(--font-display);
    font-weight: 700;
    padding: 16px 20px;
}

.cst-content .card-body {
    padding: 20px;
}

.cst-content .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-weight: 600;
    transition: all 0.2s;
}

.cst-content .btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(59,130,246,0.25);
}

.cst-content .btn-danger {
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-weight: 600;
}

.cst-content .btn-success {
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-weight: 600;
}

.cst-content .btn-warning {
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-weight: 600;
}

.cst-content .btn-dark {
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-weight: 600;
}

.cst-content .btn-outline-dark {
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-weight: 600;
    transition: all 0.2s;
}

.cst-content .btn-outline-dark:hover {
    transform: translateY(-1px);
}

.cst-content .table {
    font-family: var(--font-body);
}

.cst-content .table thead th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #e2e8f0;
    padding: 12px 16px;
}

.cst-content .table td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cst-content .table-striped tbody tr:nth-of-type(odd) {
    background-color: #fafbfd;
}

.cst-content .table tbody tr:hover {
    background-color: var(--bg-card-hover);
}

.cst-content .alert {
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.88rem;
    border: none;
}

.cst-content .badge {
    font-family: var(--font-body);
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
}

.cst-content .modal-content {
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.cst-content .modal-header {
    border-bottom: 1px solid var(--border-card);
    padding: 20px 24px;
}

.cst-content .modal-title {
    font-family: var(--font-display);
    font-weight: 700;
}

.cst-content .modal-body {
    padding: 24px;
}

.cst-content .modal-footer {
    border-top: 1px solid var(--border-card);
    padding: 16px 24px;
}

/* Accordion */

.cst-content .accordion .card {
    margin-bottom: 8px;
}

.cst-content .accordion .card-header {
    cursor: pointer;
    transition: background 0.2s;
}

.cst-content .accordion .card-header:hover {
    background: var(--bg-card-hover);
}

/* Tabs */

.cst-content .nav-tabs {
    border-bottom: 2px solid #e2e8f0;
}

.cst-content .nav-tabs .nav-link {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-muted);
    border: none;
    padding: 10px 20px;
    transition: color 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.cst-content .nav-tabs .nav-link:hover {
    color: var(--accent);
    border-color: transparent;
    border-bottom-color: var(--accent-light);
}

.cst-content .nav-tabs .nav-link.active {
    color: var(--accent);
    border-color: transparent;
    border-bottom: 2px solid var(--accent);
    background: transparent;
}

/* ---- Responsive ---- */

.cst-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1035;
}

@media screen and (max-width: 768px) {
    .cst-sidebar {
        transform: translateX(-100%);
    }

    .cst-sidebar.open {
        transform: translateX(0);
    }

    .cst-sidebar-overlay.open {
        display: block;
    }

    .cst-main {
        margin-left: 0;
    }

    .cst-hamburger {
        display: flex;
    }

    .cst-content {
        padding: 20px 16px;
    }

    .cst-topbar {
        padding: 0 16px;
    }

    .cst-feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media screen and (max-width: 480px) {
    .cst-feature-grid {
        grid-template-columns: 1fr;
    }

    .cst-content {
        padding: 16px 12px;
    }
}

/* ---- Login page specific ---- */

.cst-login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--bg-body);
    font-family: var(--font-body);
}

.cst-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    animation: cstFadeIn 0.4s ease;
}

.cst-login-header {
    padding: 32px 24px 28px;
    text-align: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
}

.cst-login-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 1.25rem;
}

.cst-login-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    color: white;
    letter-spacing: -0.02em;
}

.cst-login-body {
    padding: 28px 28px 24px;
}

.cst-login-field {
    margin-bottom: 18px;
}

.cst-login-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.cst-login-label i {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cst-login-field input,
.cst-login-field .form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-body);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafbfc;
}

.cst-login-field input:focus,
.cst-login-field .form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: white;
}

.cst-login-btn {
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cst-login-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(59,130,246,0.3);
    transform: translateY(-1px);
}

.cst-login-forgot {
    text-align: right;
    margin-bottom: 18px;
}

.cst-login-forgot a {
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.cst-login-forgot a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.cst-login-footer {
    padding: 16px 28px 20px;
    text-align: center;
    background: #f8fafc;
    border-top: 1px solid var(--border-card);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cst-login-footer a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

.cst-login-footer a:hover {
    text-decoration: underline;
}

@keyframes cstFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Section Title ---- */

.cst-section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.cst-section-subtitle {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ---- Utilities ---- */

.cst-gap-sm { gap: 8px; }
.cst-gap-md { gap: 16px; }
.cst-gap-lg { gap: 24px; }

.cst-mb-sm { margin-bottom: 8px; }
.cst-mb-md { margin-bottom: 16px; }
.cst-mb-lg { margin-bottom: 24px; }
.cst-mb-xl { margin-bottom: 32px; }
