/*
 * System Styles - admin.eqlab.vn
 * Theme: Dark Mode + Glassmorphism
 */

:root {
    --bg-dark: #0f172a;
    --bg-dark-lighter: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);

    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #475569;
    --secondary-hover: #334155;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --sidebar-width: 260px;
    --header-height: 70px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 15px;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

/* =========================================================================
   LOGIN PAGE
   ========================================================================= */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #312e81, #0f172a);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-glass {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.login-header .logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    margin: 0 auto 15px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 5px;
}

/* =========================================================================
   LAYOUT (SIDEBAR + HEADER)
   ========================================================================= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--bg-dark-lighter);
    border-right: 1px solid var(--border-color);
    z-index: 100;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.sidebar-header .logo i {
    color: var(--primary);
    font-size: 24px;
}

.sidebar .toggle-btn,
.mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar .toggle-btn:hover,
.mobile-menu-btn:hover {
    color: white;
}

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

.nav-list {
    padding: 20px 10px;
    flex: 1;
    overflow-y: auto;
}

.nav-list li {
    margin-bottom: 5px;
}

.nav-list li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-list li a:hover,
.nav-list li.active a {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.nav-list li a i {
    font-size: 20px;
}

.nav-divider {
    padding: 15px 15px 5px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #475569;
    font-weight: 600;
}

.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.header {
    height: var(--header-height);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left h2 {
    font-size: 18px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

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

.user-info .name {
    font-weight: 600;
    font-size: 14px;
}

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

.logout-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    font-size: 20px;
    transition: var(--transition);
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
}

.content-body {
    padding: 30px;
    flex: 1;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .links_name,
.sidebar.collapsed .nav-divider {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

.main-wrapper.expanded {
    margin-left: 80px;
}

/* =========================================================================
   COMPONENTS (FORMS, BUTTONS, CARDS)
   ========================================================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 6px;
    overflow: hidden;
}

.card-header {
    padding: 5px 8px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.card-header h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 6px;
}

.p-0 {
    padding: 0 !important;
}

.mb-4 {
    margin-bottom: 6px !important;
}

.mt-3 {
    margin-top: 16px !important;
}

.text-center {
    text-align: center !important;
}

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

.fw-bold {
    font-weight: 600 !important;
}

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

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

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

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

/* Form Controls */
.form-group {
    margin-bottom: 4px;
}

.form-group label {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
    color: var(--text-muted);
}

.form-group label .required {
    color: var(--danger);
}

.form-control,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
    min-height: 32px;
}

.form-control:focus,
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-icon {
    position: relative;
}

.input-icon i:first-child {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px;
}

.input-icon input {
    padding-left: 45px;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

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

.btn-block {
    width: 100%;
}

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

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

.btn-secondary {
    background: var(--secondary);
    color: white;
}

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

.btn-danger {
    background: var(--danger);
    color: white;
}

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

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}


/* =========================================================================
   DASHBOARD SPECIFIC
   ========================================================================= */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
}

.welcome-message h3 {
    font-size: 24px;
    margin-bottom: 5px;
}

.welcome-message p {
    color: var(--text-muted);
}

/* Dashboard Indicators - Compact List */
.indicator-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 14px;
    margin-bottom: 8px;
}

.indicator-search-bar i {
    color: var(--text-muted);
    font-size: 18px;
}

.indicator-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 14px;
}

.indicator-search-bar input::placeholder {
    color: var(--text-muted);
}

.indicator-count {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.indicator-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.indicator-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    color: inherit;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-color);
}

.indicator-row:last-of-type {
    border-bottom: none;
}

.indicator-row:hover {
    background: rgba(99, 102, 241, 0.08);
}

.indicator-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.indicator-row-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.indicator-row-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.indicator-row-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.indicator-row-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.indicator-row-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    white-space: nowrap;
}

.indicator-row-count {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.indicator-row-arrow {
    color: var(--text-muted);
    font-size: 18px;
}

.indicator-no-result {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Legacy: keep indicators-grid for empty state */
.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* =========================================================================
   BADGES
   ========================================================================= */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

/* =========================================================================
   JSPREADSHEET DARK THEME OVERRIDES
   ========================================================================= */
.jexcel_container {
    border-radius: 8px;
    width: 100% !important;
    display: block !important;
}

.jexcel_content {
    overflow-x: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    -webkit-overflow-scrolling: touch;
}

.jexcel_container,
.jexcel_container * {
    touch-action: manipulation !important; /* Vô hiệu hóa hoàn toàn double-tap to zoom cho mọi thành phần trong bảng tính */
}

.jexcel {
    min-width: max-content !important;
    background: var(--bg-dark-lighter) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

.jexcel td,
.jexcel th {
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-main) !important;
    background: var(--bg-dark-lighter) !important;
    padding: 2px 4px !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    height: 24px !important;
    touch-action: manipulation !important; /* Vô hiệu hóa double-tap to zoom trên Safari/iOS */
}

.jexcel td.jexcel_selected,
.jexcel td.highlight {
    background: rgba(99, 102, 241, 0.2) !important;
}

.jexcel thead td {
    background: rgba(0, 0, 0, 0.3) !important;
    color: var(--text-muted) !important;
    font-weight: 600;
    font-size: 11px;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding: 4px 2px !important;
    height: auto !important;
}

.jexcel thead tr {
    height: auto !important;
}

.jexcel tbody tr td:first-child {
    background: rgba(0, 0, 0, 0.2) !important;
    color: var(--text-muted) !important;
}

.jexcel .jexcel_content {
    background: var(--bg-dark-lighter) !important;
}

.jexcel input,
.jexcel textarea {
    background: rgba(15, 23, 42, 0.9) !important;
    color: white !important;
    border: 1px solid var(--primary) !important;
}

.btn-info {
    background: var(--info);
    color: white;
    border: none;
}

.btn-info:hover {
    background: #2563eb;
}


/* =========================================================================
   COD MODULE SPECIFIC
   ========================================================================= */
.form-section {
    margin-bottom: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-section h4 {
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

.form-row.four-cols .form-group {
    min-width: 150px;
}

.preview-box {
    background: rgba(15, 23, 42, 0.8);
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid var(--secondary);
    flex: 1;
    min-width: 150px;
}

.preview-box.highlight {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.preview-box .calc-result {
    font-size: 15px;
    font-weight: 700;
}

.preview-box.highlight .calc-result {
    color: var(--success);
    font-size: 16px;
}

.preview-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* DATA TABLE */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: max-content !important; /* Thêm !important để ghi đè triệt để thuộc tính width: 100% ẩn bên trong class .table của Bootstrap */
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 2px 4px !important;
    border: 1px solid var(--border-color);
    font-size: 11.5px;
    line-height: 1.25;
    min-width: 45px; /* Chiều rộng tối thiểu bằng cột STT */
}

.data-table tbody td {
    white-space: nowrap !important; /* Lấy độ rộng cột theo nội dung (từ dòng 2 trở đi) */
}

.data-table thead th {
    background: rgba(255, 255, 255, 0.05);
    text-align: center;
    font-weight: 600;
    vertical-align: middle;
    padding: 3px 3px !important;
    font-size: 11px;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
    width: 1px !important; /* Ép tiêu đề co lại tối đa để nhường quyền quyết định độ rộng cho dữ liệu tbody */
}

.data-table .btn-icon {
    font-size: 15px;
    padding: 1px 3px;
}

.data-table .badge {
    padding: 1px 4px;
    font-size: 10px;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table td.loading,
.data-table td.empty {
    padding: 40px;
    color: var(--text-muted);
}

/* Cố định cột STT và Mã ID khi cuộn ngang */
.data-table.sticky-table {
    border-collapse: separate;
    border-spacing: 0;
}

.data-table.sticky-table th,
.data-table.sticky-table td {
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.data-table.sticky-table thead tr th {
    border-top: 1px solid var(--border-color);
}

.data-table.sticky-table tr td:first-child,
.data-table.sticky-table tr th:first-child {
    border-left: 1px solid var(--border-color);
}

.data-table.sticky-table th.sticky-col-1,
.data-table.sticky-table td.sticky-col-1 {
    position: sticky;
    left: 0;
    z-index: 4;
    background: #1e293b;
    width: 45px;
    min-width: 45px;
    max-width: 45px;
    text-align: center;
}

.data-table.sticky-table th.sticky-col-2,
.data-table.sticky-table td.sticky-col-2 {
    position: sticky;
    left: 45px;
    z-index: 4;
    background: #1e293b;
    border-right: 2px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 4px 0 8px rgba(0, 0, 0, 0.35);
}

.data-table.sticky-table thead th.sticky-col-1,
.data-table.sticky-table thead th.sticky-col-2 {
    z-index: 6;
    background: #0f172a;
}

.data-table.sticky-table tbody tr:hover td.sticky-col-1,
.data-table.sticky-table tbody tr:hover td.sticky-col-2 {
    background: #334155;
}

/* =========================================================================
   MODALS & TOASTS
   ========================================================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-dark-lighter);
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-sm {
    max-width: 400px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
}

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    font-size: 24px;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

/* =========================================================================
   RESPONSIVE (MOBILE)
   ========================================================================= */
@media (max-width: 992px) {
    .preview-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

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

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

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

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

    .sidebar .toggle-btn {
        display: none;
    }

    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 90;
        display: none;
    }

    .mobile-overlay.show {
        display: block;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .form-section {
        margin-bottom: 4px !important;
        padding: 8px !important;
    }

    .form-section h4 {
        margin-bottom: 4px !important;
        font-size: 13px !important;
    }

    .form-row {
        gap: 4px !important;
    }

    .form-row .form-group,
    .form-row.three-cols .form-group {
        min-width: 100% !important;
        flex: 1 1 100% !important;
        margin-bottom: 4px !important;
    }

    .form-row.two-cols .form-group,
    .form-row.four-cols .form-group {
        min-width: calc(50% - 2px) !important;
        flex: 1 1 calc(50% - 2px) !important;
        margin-bottom: 4px !important;
    }

    .form-group {
        margin-bottom: 4px !important;
    }

    .form-group label {
        margin-bottom: 0px !important;
        font-size: 11px !important;
    }

    .form-control,
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    textarea,
    select {
        padding: 4px 8px !important;
        font-size: 13px !important;
        min-height: 32px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .card-body {
        padding: 10px !important;
    }

    .header {
        padding: 0 10px !important;
    }

    .content-body {
        padding: 5px !important;
    }
}

/* ============================================================
 * MOBILE IN-APP NUMPAD (Custom Spreadsheet Virtual Keypad)
 * ============================================================ */
.custom-numpad-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 10px)) 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: numpadSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 540px;
    margin: 0 auto;
}

@keyframes numpadSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

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

.numpad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.numpad-info {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.numpad-fx-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.4);
    font-size: 13px;
    font-weight: 700;
    font-style: italic;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.numpad-title-wrap {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.numpad-sample-id {
    font-size: 13px;
    font-weight: 700;
    color: #38bdf8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.numpad-field-name {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.numpad-header-actions {
    display: flex;
    gap: 6px;
}

.numpad-btn-icon {
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.numpad-btn-icon:active {
    transform: scale(0.92);
    background: rgba(71, 85, 105, 0.8);
}

.numpad-btn-close {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.numpad-display-bar {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 6px 12px;
    gap: 8px;
    min-height: 44px;
}

.numpad-display-value {
    flex: 1;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 22px;
    font-weight: 700;
    color: #10b981;
    text-align: right;
    white-space: nowrap;
    overflow-x: auto;
    letter-spacing: 1px;
}

.numpad-display-value.empty {
    color: #64748b;
    font-weight: 400;
}

.numpad-btn-backspace {
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    touch-action: manipulation;
}

.numpad-btn-backspace:active {
    transform: scale(0.92);
    background: rgba(71, 85, 105, 1);
}

.numpad-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 2px;
}

.numpad-key {
    height: 48px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: inherit;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.05s ease, background-color 0.1s ease;
}

.numpad-key:active {
    transform: scale(0.93);
}

.numpad-digit {
    background: rgba(30, 41, 59, 0.85);
    color: #f8fafc;
    font-size: 22px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.numpad-digit:active {
    background: rgba(51, 65, 85, 0.95);
}

.numpad-nav {
    background: rgba(30, 41, 59, 0.6);
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    gap: 3px;
}

.numpad-nav:active {
    background: rgba(51, 65, 85, 0.8);
    color: #f8fafc;
}

.numpad-action-done {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
    font-size: 14px;
    font-weight: 600;
}

.numpad-action-done:active {
    background: rgba(59, 130, 246, 0.3);
}

.numpad-action-enter {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border-color: rgba(16, 185, 129, 0.5);
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    display: flex;
    gap: 4px;
}

.numpad-action-enter:active {
    background: linear-gradient(135deg, #059669, #047857);
}

/* Highlight active editing cell in Jspreadsheet */
.jexcel tbody tr td.custom-numpad-active-cell {
    outline: 2px solid #10b981 !important;
    background: rgba(16, 185, 129, 0.2) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4) !important;
}
/* Report Dropdown Item */
.report-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.report-dropdown-item:hover {
    background: var(--bg-input);
}

.report-dropdown-item i {
    font-size: 18px;
    color: var(--accent);
}
