/* ==========================================
   DESIGN TOKENS & CSS VARIABLES
=========================================== */
:root {
    /* Brand Colors */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-soft: rgba(59, 130, 246, 0.12);

    --emerald: #10b981;
    --emerald-hover: #059669;
    --emerald-soft: rgba(16, 185, 129, 0.12);

    --amber: #f59e0b;
    --amber-soft: rgba(245, 158, 11, 0.12);

    --rose: #ef4444;
    --rose-soft: rgba(239, 68, 68, 0.12);

    --purple: #8b5cf6;
    --purple-soft: rgba(139, 92, 246, 0.12);

    --telegram: #0284c7;
    --telegram-hover: #0369a1;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ==========================================
   DARK THEME (Default)
=========================================== */
body.dark-theme {
    --bg-main: #0b0f19;
    --bg-sidebar: #0f172a;
    --bg-card: #131d31;
    --bg-card-hover: #17233c;
    --bg-input: #1e293b;
    --border-color: #1e293b;
    --border-subtle: rgba(255, 255, 255, 0.08);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.45);

    --login-bg: radial-gradient(circle at top, #1e293b 0%, #0b0f19 75%);
    --card-glass: rgba(19, 29, 49, 0.95);
}

/* ==========================================
   LIGHT THEME
=========================================== */
body.light-theme {
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #f1f5f9;
    --border-color: #e2e8f0;
    --border-subtle: rgba(0, 0, 0, 0.06);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);

    --login-bg: radial-gradient(circle at top, #e2e8f0 0%, #f8fafc 80%);
    --card-glass: rgba(255, 255, 255, 0.96);
}

/* ==========================================
   GLOBAL RESET
=========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================
   LOGIN SCREEN
=========================================== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--login-bg);
    position: relative;
}

.login-theme-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
}

.login-glass-card {
    background: var(--card-glass);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    padding: 42px 36px;
    animation: fadeIn 0.4s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.brand-badge {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.login-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.login-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.login-form .form-group {
    width: 100%;
    margin-bottom: 0;
}

.input-icon-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon-group i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
}

.input-icon-group input {
    width: 100% !important;
    height: 48px;
    padding-left: 42px !important;
    padding-right: 14px !important;
    font-size: 14px;
    border-radius: var(--radius-md);
}

.login-footer {
    margin-top: 25px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================
   LAYOUT: SIDEBAR & MAIN WRAPPER
=========================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease, background 0.25s ease, border-color 0.25s ease;
}

.sidebar-brand {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon-sm {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.brand-title h3 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.brand-title span {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 11px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    position: relative;
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.nav-item.active .kbd-hint {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.kbd-hint {
    margin-left: auto;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 14px;
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================
   TOPBAR
=========================================== */
.main-wrapper {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-main);
    transition: background 0.25s ease;
}

.topbar {
    height: 68px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
}

/* ==========================================
   BOT STATUS PILL
=========================================== */
.bot-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bot-status-pill:hover {
    border-color: var(--primary);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.bot-status-pill.online .pulse-dot {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
}

.bot-status-pill.offline .pulse-dot {
    background: #ef4444;
}

.status-refresh-icon {
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: 2px;
    transition: transform 0.3s ease;
}

.status-refresh-icon:hover {
    color: var(--primary);
    transform: rotate(180deg);
}

/* ==========================================
   TAB CONTENTS & GRIDS
=========================================== */
.tab-content {
    display: none;
    padding: 28px;
    animation: fadeIn 0.25s ease-out;
}

.tab-content.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

.icon-emerald {
    background: var(--emerald-soft);
    color: var(--emerald);
}

.icon-blue {
    background: var(--primary-soft);
    color: var(--primary);
}

.icon-purple {
    background: var(--purple-soft);
    color: var(--purple);
}

.icon-amber {
    background: var(--amber-soft);
    color: var(--amber);
}

.icon-telegram {
    background: rgba(2, 132, 199, 0.15);
    color: #0284c7;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 3px;
    letter-spacing: -0.5px;
}

.content-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ==========================================
   PANEL CARDS & HEADERS
=========================================== */
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 14px;
}

.panel-header.flex-wrap {
    flex-wrap: wrap;
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.panel-header p {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.max-w-700 {
    max-width: 700px;
    margin: 0 auto;
}

/* ==========================================
   TABLES & DATA DISPLAY
=========================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    padding: 12px 14px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: var(--bg-card-hover);
}

.amount-cell {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--emerald);
}

.desc-cell {
    max-width: 280px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

.client-badge {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}

.client-badge:hover {
    text-decoration: underline;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.client-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.empty-cell {
    padding: 40px !important;
    color: var(--text-muted);
}

.empty-cell i {
    font-size: 28px;
    margin-bottom: 8px;
}

/* ==========================================
   BUTTONS & INPUTS
=========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 20px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

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

.btn-telegram:hover {
    background: var(--telegram-hover);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

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

.btn-emerald:hover {
    background: var(--emerald-hover);
}

.btn-danger {
    background: var(--rose);
    color: #ffffff;
}

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

.btn-danger-soft {
    background: var(--rose-soft);
    color: var(--rose);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger-soft:hover {
    background: var(--rose);
    color: #ffffff;
}

.btn-action {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s ease;
}

.btn-action:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.btn-action-delete:hover {
    background: var(--rose);
    color: #ffffff;
    border-color: var(--rose);
}

.btn-action-edit:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.kbd-badge {
    background: rgba(255, 255, 255, 0.2);
    font-size: 9.5px;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

/* ==========================================
   FILTER PILLS & SEARCH BOX
=========================================== */
.filter-pills-group {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2px;
    gap: 2px;
}

.filter-pill {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-pill:hover {
    color: var(--text-primary);
}

.filter-pill.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.search-box input {
    padding-left: 34px !important;
    min-width: 220px;
}

.select-wrapper select,
select.form-control {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    outline: none;
}

/* Form Controls */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.help-text {
    font-size: 11.5px;
    color: var(--text-muted);
}

.label-with-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================
   QUICK PRESETS & PILLS
=========================================== */
.template-pills,
.amount-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 8px 0;
}

.pill-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pill-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.pill-amount {
    background: var(--emerald-soft);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--emerald);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 700;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s ease;
}

.pill-amount:hover {
    background: var(--emerald);
    color: #ffffff;
}

/* ==========================================
   DASHBOARD MINI CARDS & QUICK ACTIONS
=========================================== */
.client-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
}

.client-mini-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.15s ease;
}

.client-mini-card:hover {
    transform: translateX(3px);
}

.client-mini-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.client-mini-info span {
    font-size: 11.5px;
    color: var(--text-muted);
}

.client-mini-total {
    font-size: 15px;
    font-weight: 700;
    color: var(--emerald);
    font-family: var(--font-mono);
}

.quick-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-action-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.qa-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.qa-text h4 {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.qa-text p {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ==========================================
   BATCH ENTRY TABLE (WIDE & SPACIOUS)
=========================================== */
.modal-card-xl {
    width: 95vw;
    max-width: 1150px;
    padding: 12px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.batch-table-container {
    max-height: 440px;
    min-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
}

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

.batch-entry-table th {
    background: var(--bg-input);
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 2;
}

.batch-entry-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.batch-row-num {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    display: block;
}

.batch-entry-table input,
.batch-entry-table textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    width: 100%;
}

.batch-entry-table input:focus,
.batch-entry-table textarea:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.batch-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 4px 0;
}

.batch-total-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--emerald-soft);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--emerald);
}

.batch-total-badge strong {
    font-size: 17px;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--emerald);
}

.batch-total-badge .count-tag {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==========================================
   MODALS
=========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    padding: 28px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-card-lg {
    max-width: 640px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.keyboard-tip {
    margin-right: auto;
    font-size: 11.5px;
    color: var(--text-muted);
}

.keyboard-tip kbd {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

/* ==========================================
   SHORTCUTS GRID & ALERTS
=========================================== */
.shortcuts-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    font-size: 12.5px;
}

.shortcut-desc {
    color: var(--text-primary);
}

.shortcut-keys kbd {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--primary);
}

.alert-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--amber);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.alert-danger {
    background: var(--rose-soft);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--rose);
}

/* ==========================================
   BADGES & UTILITIES
=========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.badge-blue {
    background: var(--primary-soft);
    color: var(--primary);
}

.badge-neutral {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.backup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.backup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 12.5px;
}

.backup-item .date {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

.btn-group-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

.toast.toast-success {
    border-left: 4px solid var(--emerald);
}

.toast.toast-error {
    border-left: 4px solid var(--rose);
}

.toast.toast-info {
    border-left: 4px solid var(--primary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

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

    .mobile-menu-btn {
        display: block;
    }

    .topbar {
        padding: 0 16px;
    }

    .tab-content {
        padding: 16px;
    }

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

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