/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Ant Design 5.x Inspired Design Tokens
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
:root {
    /* Brand — Ant Design Blue */
    --primary:        #1677ff;
    --primary-hover:  #4096ff;
    --primary-light:  #e6f4ff;
    --primary-soft:   #91caff;
    --primary-dark:   #0958d9;

    /* Semantic — Ant Design palette */
    --success:        #52c41a;
    --success-light:  #f6ffed;
    --success-border: #b7eb8f;
    --success-dark:   #389e0d;

    --warning:        #faad14;
    --warning-light:  #fffbe6;
    --warning-border: #ffe58f;

    --error:          #ff4d4f;
    --error-light:    #fff2f0;
    --error-border:   #ffccc7;
    --error-dark:     #cf1322;

    --info:           #1677ff;
    --info-light:     #e6f4ff;
    --info-border:    #91caff;

    /* Sidebar */
    --sidebar-width:           252px;
    --sidebar-collapsed-width: 64px;
    --sidebar-bg:              #001529;
    --sidebar-border:          #001529;
    --sidebar-text:            rgba(255,255,255,0.65);
    --sidebar-text-hover:      #ffffff;
    --sidebar-active-bg:       #1677ff;
    --sidebar-active-text:     #ffffff;
    --sidebar-hover-bg:        rgba(255,255,255,0.08);
    --sidebar-section-label:   rgba(255,255,255,0.35);

    /* Neutrals — Ant Design neutral palette */
    --white:      #ffffff;
    --bg-body:    #f5f5f5;
    --slate-50:   #fafafa;
    --slate-100:  #f5f5f5;
    --slate-200:  #f0f0f0;
    --slate-300:  #d9d9d9;
    --slate-400:  #bfbfbf;
    --slate-500:  #8c8c8c;
    --slate-600:  #595959;
    --slate-700:  #434343;
    --slate-800:  #262626;
    --slate-900:  #141414;

    /* Text — Ant Design text hierarchy */
    --text-main:   rgba(0,0,0,0.88);
    --text-muted:  rgba(0,0,0,0.45);
    --text-subtle: rgba(0,0,0,0.25);

    /* Borders */
    --border:       #d9d9d9;
    --border-color: #d9d9d9;
    --border-light: #f0f0f0;

    /* Shadows — Ant Design elevation */
    --shadow-xs: 0 1px 2px 0 rgba(0,0,0,0.03), 0 1px 6px -1px rgba(0,0,0,0.02), 0 2px 4px 0 rgba(0,0,0,0.02);
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.03), 0 1px 6px -1px rgba(0,0,0,0.02), 0 2px 4px 0 rgba(0,0,0,0.02);
    --shadow:    0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05);
    --shadow-lg: 0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05);

    /* Radius — Ant Design uses 6px base */
    --radius-xs: 4px;
    --radius-sm: 4px;
    --radius:    6px;
    --radius-md: 8px;
    --radius-lg: 8px;
    --radius-xl: 8px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Reset
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5714285714;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

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

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Sidebar — Ant Design dark sider
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: width 0.2s cubic-bezier(0.2,0,0,1);
    overflow: visible;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    flex-shrink: 0;
}

.sidebar-header .logo-full {
    filter: brightness(0) invert(1);
}

nav {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

nav::-webkit-scrollbar { width: 0; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0 16px;
    height: 40px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s cubic-bezier(0.2,0,0,1);
    white-space: nowrap;
    position: relative;
}

.nav-link:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-hover);
}

.nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 500;
}

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

.nav-text { transition: opacity 0.2s; }

.nav-section-label {
    padding: 1.25rem 16px 0.375rem;
    font-size: 12px;
    font-weight: 600;
    color: var(--sidebar-section-label);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

/* Sidebar footer */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0.5rem;
    flex-shrink: 0;
    position: relative;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.sidebar-user:hover { background: rgba(255,255,255,0.08); }

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

.sidebar-user-name {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sidebar-user-role {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    text-transform: capitalize;
    line-height: 1.3;
}

/* Sidebar user dropdown */
.sidebar-user-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 4px;
    right: 4px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    z-index: 200;
    overflow: hidden;
    padding: 4px;
}

.sidebar-user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 5px 12px;
    font-size: 14px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    height: 32px;
}

.sidebar-user-dropdown a:hover {
    background: var(--slate-100);
    color: var(--text-main);
}

.sidebar-user-dropdown a.danger { color: var(--error); }
.sidebar-user-dropdown a.danger:hover {
    background: var(--error-light);
    color: var(--error-dark);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* Version + collapse row */
.sidebar-collapse-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.25rem 0;
    margin-top: 0.25rem;
}

.sidebar-version {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-left: 0.375rem;
}

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: rgba(255,255,255,0.45);
    background: none;
    border: none;
    transition: all 0.2s;
}

.sidebar-collapse-btn:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
}

/* ── Collapsed state ─────────────────────────── */
.sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.sidebar.collapsed .logo-full          { display: none; }
.sidebar.collapsed .logo-collapsed     { display: block !important; filter: brightness(0) invert(1); }
.sidebar.collapsed .nav-text           { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .nav-section-label  { opacity: 0; height: 0; padding: 0; overflow: hidden; }
.sidebar.collapsed .nav-link           { justify-content: center; padding: 0; }
.sidebar.collapsed .sidebar-header     { justify-content: center; padding: 1rem 0.25rem; }
.sidebar.collapsed .sidebar-user-info  { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .sidebar-user       { justify-content: center; padding: 0.5rem 0; gap: 0; }
.sidebar.collapsed .sidebar-user-row   { flex-direction: column; align-items: center; gap: 4px; }
.sidebar.collapsed .sidebar-user svg[width="12"] { display: none; }
.sidebar.collapsed .sidebar-version    { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .sidebar-user-dropdown {
    left: 100%;
    right: auto;
    bottom: 0;
    width: 180px;
    margin-left: 6px;
}

/* Tooltip on collapse */
.sidebar.collapsed .nav-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--radius);
    white-space: nowrap;
    font-size: 14px;
    font-weight: 400;
    z-index: 1000;
    box-shadow: var(--shadow);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.sidebar.collapsed .nav-link:hover::after { opacity: 1; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Main Content
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 24px;
    transition: margin-left 0.2s cubic-bezier(0.2,0,0,1);
}

.main-content.expanded { margin-left: var(--sidebar-collapsed-width); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Page Header
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.page-header {
    margin-bottom: 24px;
}

.page-header h1,
.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    margin: 0;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.page-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
}

h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.header-section { margin-bottom: 24px; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Cards — Ant Design Card
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    min-height: 56px;
}

.card-header h2, .card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.card-body { padding: 24px; }

.card-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--slate-50);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Metric / Stat Cards — Ant Design Statistic
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 16px;
}

.stat-card, .metric-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s;
    position: relative;
}

.stat-card:hover, .metric-card:hover {
    box-shadow: var(--shadow-sm);
}

.stat-label, .metric-label {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: none;
    letter-spacing: normal;
}

.stat-value, .metric-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.33;
}

.stat-delta, .metric-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Accent border variants — Ant Design colors */
.metric-card.accent-indigo  { border-top: 3px solid var(--primary); }
.metric-card.accent-blue    { border-top: 3px solid #1677ff; }
.metric-card.accent-green   { border-top: 3px solid var(--success); }
.metric-card.accent-red     { border-top: 3px solid var(--error); }
.metric-card.accent-amber   { border-top: 3px solid var(--warning); }
.metric-card.accent-purple  { border-top: 3px solid #722ed1; }
.metric-card.accent-orange  { border-top: 3px solid #fa8c16; }
.metric-card.accent-teal    { border-top: 3px solid #13c2c2; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Feature / Action Cards
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.feature-cards-grid, .workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.feature-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.feature-card:hover {
    border-color: var(--primary-soft);
    box-shadow: var(--shadow-sm);
    color: inherit;
}

.feature-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

/* Icon wrapper color variants — use instead of inline style on .feature-icon-wrapper */
.icon-blue   { background: #e6f4ff; color: #1677ff; }
.icon-green  { background: #f6ffed; color: #52c41a; }
.icon-amber  { background: #fffbe6; color: #faad14; }
.icon-red    { background: #fff2f0; color: #ff4d4f; }
.icon-purple { background: #f9f0ff; color: #722ed1; }
.icon-pink   { background: #fff0f6; color: #eb2f96; }
.icon-teal   { background: #e6fffb; color: #13c2c2; }
.icon-slate  { background: var(--slate-100); color: var(--slate-600); }

/* Large icon variant — 56 × 56, used in metric cards */
.icon-lg { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; }

/* Horizontal feature card — icon | content | arrow in a row */
.feature-card-h {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
}
.feature-card-h .feature-icon-wrapper {
    margin-bottom: 0;
}
.feature-card-h .feature-card-body {
    flex: 1;
    min-width: 0;
}
.feature-card-h .feature-card-body .feature-title { margin-bottom: 2px; }
.feature-card-h .feature-card-body .feature-description { margin-bottom: 0; }
.feature-card-h .feature-card-arrow {
    color: var(--text-subtle);
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
}
.feature-card-h:hover .feature-card-arrow {
    transform: translateX(3px);
    color: var(--primary);
}

/* 2-column grid for operations panel */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* Operations tile grid */
.ops-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}
@media (max-width: 1100px) {
    .ops-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .ops-grid { grid-template-columns: repeat(2, 1fr); }
}

.ops-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 18px 18px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid var(--border-light);
    border-top: 3px solid transparent;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    gap: 10px;
    transition: box-shadow 0.2s, transform 0.15s, border-top-color 0.2s;
}
.ops-tile:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.09);
    transform: translateY(-2px);
    color: inherit;
}
.ops-tile .ops-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ops-tile .ops-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}
.ops-tile .ops-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: -4px;
}
.ops-tile-blue   { border-top-color: #1677ff; }
.ops-tile-amber  { border-top-color: #faad14; }
.ops-tile-green  { border-top-color: #52c41a; }
.ops-tile-pink   { border-top-color: #eb2f96; }
.ops-tile-purple { border-top-color: #722ed1; }

.feature-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    line-height: 1.5;
}

.feature-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5714;
    flex-grow: 1;
    margin-bottom: 16px;
}

.feature-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Buttons — Ant Design Button
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 15px;
    font-size: 14px;
    font-weight: 400;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.645,0.045,0.355,1);
    border: 1px solid transparent;
    font-family: inherit;
    line-height: 1.5714;
    height: 32px;
    text-decoration: none;
    white-space: nowrap;
    outline: none;
    user-select: none;
}

.btn:active { transform: none; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 0 rgba(5,145,255,0.1);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: all 0.2s;
    flex-shrink: 0;
}
.btn-back:hover {
    background: var(--slate-100);
    color: var(--text-main);
}

.btn-secondary {
    background: var(--slate-800);
    color: #fff;
    border-color: var(--slate-800);
}
.btn-secondary:hover { background: var(--slate-700); border-color: var(--slate-700); }

.btn-outline {
    background: #fff;
    border-color: var(--border);
    color: var(--text-main);
    box-shadow: 0 2px 0 rgba(0,0,0,0.02);
}
.btn-outline:hover { color: var(--primary); border-color: var(--primary); }

.btn-ghost {
    background: transparent;
    color: var(--text-main);
    border-color: transparent;
}
.btn-ghost:hover { background: rgba(0,0,0,0.04); }

.btn-danger {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
    box-shadow: 0 2px 0 rgba(255,38,5,0.06);
}
.btn-danger:hover { background: #ff7875; border-color: #ff7875; }

.btn-danger-outline {
    background: #fff;
    border-color: var(--error);
    color: var(--error);
}
.btn-danger-outline:hover { background: var(--error-light); color: var(--error-dark); border-color: var(--error-dark); }

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

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}
.btn-warning:hover { background: #ffc53d; border-color: #ffc53d; }

.btn-sm  { padding: 0 7px; font-size: 14px; height: 24px; border-radius: var(--radius-sm); }
.btn-lg  { padding: 7px 15px; font-size: 16px; height: 40px; }
.btn-xl  { padding: 7px 15px; font-size: 16px; height: 40px; }
.btn-icon { padding: 0; width: 32px; height: 32px; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Forms — Ant Design Input / Select
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.form-group { margin-bottom: 24px; }

label {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-control,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 4px 11px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text-main);
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1.5714;
    height: 32px;
    appearance: none;
    -webkit-appearance: none;
}

.form-control:hover,
input[type="text"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="search"]:hover,
select:hover,
textarea:hover {
    border-color: var(--primary-hover);
}

.form-control:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(5,145,255,0.06);
}

.form-control:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    background: var(--slate-100);
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--border);
}

textarea.form-control {
    resize: vertical;
    min-height: 88px;
    height: auto;
}

select.form-control,
select {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23bfbfbf' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 32px;
    cursor: pointer;
}

.form-hint {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: repeat(4, 1fr); }

/* Compact form group — no bottom margin, for filter bars / inline forms */
.form-group-0 { margin-bottom: 0; }

/* Filter bar — horizontal row of compact inputs */
.filter-bar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-bar .form-group { margin-bottom: 0; }
.filter-bar label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }

/* Short-width inputs for inline/filter use */
.input-sm  { width: 100px !important; }
.input-md  { width: 160px !important; }
.input-qty { width: 64px  !important; }

/* Grid span helpers */
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

/* Required field marker */
.required-mark { color: var(--error); margin-left: 2px; }
label.required::after { content: " *"; color: var(--error); }

/* Form section — used inside a card to group related fields */
.form-section {
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}
.form-section:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
}

/* Section divider heading inside a card form */
.section-divider {
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}
.section-divider:first-child { margin-top: 1.5rem; }

/* Input group — input + button side by side */
.input-group {
    display: flex;
    align-items: stretch;
}
.input-group .form-control { border-radius: var(--radius) 0 0 var(--radius); flex: 1; }
.input-group .btn          { border-radius: 0 var(--radius) var(--radius) 0; height: 32px; }

/* Info / context boxes */
.info-box {
    background: var(--info-light);
    border: 1px solid var(--info-border);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-main);
}

/* Neutral grouped checkbox/toggle row */
.checkbox-group {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    background: var(--bg-subtle, #f8fafc);
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: var(--radius);
}
.checkbox-group label { margin: 0; font-weight: normal; font-size: 0.8rem; }

.warning-box {
    background: var(--warning-light);
    border: 1px solid var(--warning-border);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-main);
}

.success-box {
    background: var(--success-light);
    border: 1px solid var(--success-border);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-main);
}

.error-box {
    background: var(--error-light);
    border: 1px solid var(--error-border);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-main);
}

/* Totals / financial summary row inside a form */
.totals-box {
    background: var(--slate-50);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.totals-row.total-final {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px dashed var(--border);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.totals-row .value {
    font-weight: 500;
    color: var(--text-main);
}

/* Role / option card for selection */
.option-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fff;
}

.option-card:hover { border-color: var(--primary-hover); background: var(--primary-light); }
.option-card.selected { border-color: var(--primary); background: var(--primary-light); }
.option-card-title { font-size: 14px; font-weight: 600; color: var(--text-main); margin-bottom: 2px; }
.option-card-desc  { font-size: 12px; color: var(--text-muted); }

/* Permission / module list row inside a card */
.module-item { padding: 0.5rem 0; border-bottom: 1px solid var(--border-light); }
.module-item:last-child { border-bottom: none; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Tables — Ant Design Table
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    background: #fff;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead tr {
    background: var(--slate-50);
    border-bottom: 1px solid var(--border-light);
}

.table th {
    text-align: left;
    padding: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    text-transform: none;
    letter-spacing: normal;
}

.table td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text-main);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.2s; }
.table tbody tr:hover td { background: var(--slate-50); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Tabs — Ant Design Tabs
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.tabs-container {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 24px;
    gap: 0;
}

.tab-btn {
    padding: 12px 0;
    margin: 0 16px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.3s;
    font-family: inherit;
    white-space: nowrap;
}

.tab-btn:first-child { margin-left: 0; }

.tab-btn:hover { color: var(--primary); }

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Alerts — Ant Design Alert
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.5714;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-success  { background: var(--success-light); color: var(--text-main); border-color: var(--success-border); }
.alert-error,
.alert-danger   { background: var(--error-light);   color: var(--text-main); border-color: var(--error-border); }
.alert-warning  { background: var(--warning-light);  color: var(--text-main); border-color: var(--warning-border); }
.alert-info     { background: var(--info-light);     color: var(--text-main); border-color: var(--info-border); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Badges — Ant Design Tag
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0 7px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    height: 22px;
    line-height: 20px;
    border: 1px solid transparent;
}

.badge-blue,
.badge-indigo  { background: #e6f4ff; color: #0958d9; border-color: #91caff; }
.badge-green   { background: #f6ffed; color: #389e0d; border-color: #b7eb8f; }
.badge-red     { background: #fff2f0; color: #cf1322; border-color: #ffccc7; }
.badge-yellow  { background: #fffbe6; color: #d48806; border-color: #ffe58f; }
.badge-orange  { background: #fff7e6; color: #d46b08; border-color: #ffd591; }
.badge-purple  { background: #f9f0ff; color: #531dab; border-color: #d3adf7; }
.badge-slate   { background: var(--slate-100); color: var(--slate-600); border-color: var(--border); }
.badge-teal    { background: #e6fffb; color: #08979c; border-color: #87e8de; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Charts / Grid layouts
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.chart-grid     { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.two-col-grid   { display: grid; grid-template-columns: 1fr 1fr;   gap: 16px; }
.three-col-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.dashboard-container { display: flex; flex-direction: column; gap: 24px; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Divider & Empty State
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.divider { height: 1px; background: var(--border-light); margin: 24px 0; }

.empty-state { text-align: center; padding: 48px 24px; }
.empty-state-title { font-size: 16px; font-weight: 500; color: var(--text-main); margin-bottom: 8px; }
.empty-state-text  { font-size: 14px; color: var(--text-muted); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Auth pages — Ant Design style
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.auth-page {
    min-height: 100vh;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 32px;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.auth-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Utilities
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-sm      { font-size: 14px; }
.text-xs      { font-size: 12px; }
.text-lg      { font-size: 16px; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 600; }
.font-mono    { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; }
.text-muted   { color: var(--text-muted); }
.text-subtle  { color: var(--text-subtle); }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.d-flex       { display: flex; }
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.items-end    { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-end  { justify-content: flex-end; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.gap-1        { gap: 4px; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.gap-4        { gap: 16px; }
.mt-1         { margin-top: 4px; }
.mt-2         { margin-top: 8px; }
.mt-4         { margin-top: 16px; }
.mt-6         { margin-top: 24px; }
.mb-2         { margin-bottom: 8px; }
.mb-4         { margin-bottom: 16px; }
.mb-6         { margin-bottom: 24px; }
.p-4          { padding: 16px; }
.w-full          { width: 100%; }
.justify-center  { justify-content: center; }

/* JS-driven tab/pane visibility — used by reports.html, daily.html */
.tab-pane     { display: none; }
.tab-pane.active  { display: block; }
.content-pane { display: none; }
.content-pane.active { display: block; }

/* Package list interactive states — used by dg_sales_counter.html */
.package-row:hover  { background-color: #f0f7ff; }
.package-row:active { background-color: #e0effe; }
.add-pkg-btn-small:hover  { transform: translateY(-1px); }
.add-pkg-btn-small:active { transform: translateY(0); }
.min-w-0      { min-width: 0; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Misc / special
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.disabled-nav {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

/* Scrollbar — subtle */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: rgba(0,0,0,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Responsive
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 1024px) {
    .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; padding: 16px; }
    .stats-grid, .metric-grid { grid-template-columns: 1fr 1fr; }
    .feature-cards-grid, .workflow-grid { grid-template-columns: 1fr; }
    .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
}

@media print {
    .sidebar, .alert { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .card { box-shadow: none; border: 1px solid #d9d9d9; }
}
