@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
    --font-family-base: "Inter", "Poppins", "Manrope", "Roboto", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-soft: #eff6ff;
    --color-secondary: #1e293b;
    --color-accent: #0ea5e9;
    --color-success: #22c55e;
    --color-success-accessible: #15803d;
    --color-success-soft: #dcfce7;
    --color-warning: #f59e0b;
    --color-warning-soft: #fef3c7;
    --color-danger: #ef4444;
    --color-danger-accessible: #dc2626;
    --color-danger-soft: #fee2e2;
    --color-background: #f8fafc;
    --color-card: #ffffff;
    --color-text: #0f172a;
    --color-text-primary: #0f172a;
    --color-text-secondary: #334155;
    --color-label: #1e293b;
    --color-muted: #64748b;
    --color-placeholder: #64748b;
    --color-border: #e2e8f0;
    --color-border-strong: #cbd5e1;
    --color-table-header: #f1f5f9;
    --font-weight-body: 500;
    --font-weight-label: 600;
    --font-weight-title: 700;
    --color-sidebar: #0f172a;
    --color-sidebar-muted: #94a3b8;
    --sidebar-width: 272px;
    --sidebar-collapsed-width: 86px;
    --topbar-height: 92px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.1);
    --transition: 180ms ease;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--color-background);
    color: var(--color-text-secondary);
    font-family: var(--font-family-base);
    font-size: 14px;
    font-weight: var(--font-weight-body);
    line-height: 1.55;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--color-primary-dark);
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--color-sidebar);
    border: 0;
    box-shadow: 10px 0 35px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 18px 16px;
    transition: width var(--transition), transform var(--transition), padding var(--transition);
    width: var(--sidebar-width);
    z-index: 1040;
}

.brand-wrap {
    align-items: center;
    display: flex;
    min-height: 58px;
    position: relative;
}

.brand {
    align-items: center;
    color: #fff;
    display: flex;
    flex: 1;
    gap: 12px;
    margin: 0;
    min-width: 0;
    padding: 6px;
}

.brand:hover {
    color: #fff;
}

.brand img {
    background: #fff;
    border-radius: var(--radius-md);
    height: 44px;
    max-height: 44px;
    max-width: 44px;
    object-fit: contain;
    padding: 5px;
    width: 44px;
}

.brand-mark,
.auth-mark {
    background: linear-gradient(145deg, var(--color-primary), var(--color-accent));
    border-radius: var(--radius-md);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
    flex: 0 0 44px;
    font-size: 20px;
    height: 44px;
    width: 44px;
}

.brand-copy {
    min-width: 0;
}

.brand-copy strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    max-width: 155px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy small {
    color: var(--color-sidebar-muted);
    font-size: 11px;
    letter-spacing: 0.04em;
}

.sidebar-collapse-btn,
.sidebar-close-btn {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: #cbd5e1;
    height: 34px;
    justify-content: center;
    transition: var(--transition);
    width: 34px;
}

.sidebar-collapse-btn:hover,
.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.sidebar-close-btn {
    display: flex;
}

.sidebar .nav {
    flex: 1;
    margin-top: 24px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}

.nav-section-label {
    color: #64748b;
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.13em;
    margin: 17px 12px 7px;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-section-label:first-child {
    margin-top: 0;
}

.sidebar .nav-link {
    align-items: center;
    border-radius: 10px;
    color: #cbd5e1;
    display: flex;
    font-size: 13px;
    font-weight: 500;
    gap: 13px;
    margin: 3px 0;
    min-height: 44px;
    padding: 10px 12px;
    position: relative;
    transition: background var(--transition), color var(--transition), transform var(--transition);
    white-space: nowrap;
}

.sidebar .nav-link i {
    flex: 0 0 22px;
    font-size: 18px;
    text-align: center;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    transform: translateX(2px);
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.95), rgba(14, 165, 233, 0.82));
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.25);
    color: #fff;
}

.sidebar .nav-link.active::after {
    background: #fff;
    border-radius: 999px;
    content: "";
    height: 18px;
    position: absolute;
    right: 8px;
    width: 3px;
}

.sidebar-logout {
    margin: 0;
}

.sidebar-logout .nav-link {
    color: #fca5a5 !important;
}

.sidebar-footer {
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    display: flex;
    gap: 10px;
    margin-top: 14px;
    padding: 11px;
}

.sidebar-help-icon {
    align-items: center;
    background: rgba(37, 99, 235, 0.22);
    border-radius: 9px;
    color: #93c5fd;
    display: flex;
    flex: 0 0 34px;
    height: 34px;
    justify-content: center;
}

.sidebar-footer-copy strong,
.sidebar-footer-copy small {
    display: block;
}

.sidebar-footer-copy strong {
    color: #e2e8f0;
    font-size: 12px;
}

.sidebar-footer-copy small {
    color: var(--color-sidebar-muted);
    font-size: 10px;
}

.sidebar-collapsed .sidebar {
    padding-left: 13px;
    padding-right: 13px;
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-link span,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .sidebar-footer-copy,
.sidebar-collapsed .sidebar .nav-link.active::after {
    display: none;
}

.sidebar-collapsed .brand-wrap {
    justify-content: center;
}

.sidebar-collapsed .brand {
    flex: 0 0 auto;
    padding: 6px 0;
}

.sidebar-collapsed .sidebar-collapse-btn {
    bottom: -34px;
    position: absolute;
    right: 11px;
    transform: rotate(180deg);
}

.sidebar-collapsed .sidebar .nav {
    margin-top: 42px;
}

.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    padding: 10px;
}

.sidebar-collapsed .sidebar .nav-link:hover {
    transform: none;
}

.sidebar-collapsed .sidebar-footer {
    justify-content: center;
    padding: 8px;
}

.sidebar-overlay {
    background: rgba(15, 23, 42, 0.55);
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity var(--transition);
    z-index: 1035;
}

/* Header */
.content {
    margin-left: var(--sidebar-width);
    padding: 0;
    transition: margin-left var(--transition), width var(--transition);
    width: calc(100% - var(--sidebar-width));
}

.sidebar-collapsed .content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

.topbar {
    align-items: center;
    backdrop-filter: blur(16px);
    background: rgba(248, 250, 252, 0.9);
    border-bottom: 1px solid rgba(226, 232, 240, 0.88);
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin: 0;
    min-height: var(--topbar-height);
    padding: 14px 30px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-title-group,
.topbar-actions {
    align-items: center;
    display: flex;
}

.topbar-title-group {
    gap: 12px;
    min-width: 0;
}

.topbar-actions {
    gap: 10px;
}

.page-breadcrumb {
    align-items: center;
    color: var(--color-muted);
    display: flex;
    font-size: 11px;
    gap: 6px;
    margin-bottom: 2px;
}

.page-breadcrumb a {
    color: var(--color-muted);
}

.page-breadcrumb i {
    font-size: 9px;
}

.page-title {
    color: var(--color-text);
    font-size: clamp(21px, 2vw, 27px);
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.page-subtitle {
    color: var(--color-muted);
    font-size: 12px;
    margin-top: 3px;
}

.header-search {
    align-items: center;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 11px;
    display: flex;
    gap: 9px;
    height: 42px;
    padding: 0 10px 0 13px;
    transition: border-color var(--transition), box-shadow var(--transition), width var(--transition);
    width: 250px;
}

.header-search:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.header-search i {
    color: var(--color-muted);
}

.header-search input {
    background: transparent;
    border: 0;
    color: var(--color-text);
    flex: 1;
    min-width: 0;
    outline: 0;
}

.header-search input::placeholder {
    color: #94a3b8;
}

.header-search kbd {
    background: #f1f5f9;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    color: var(--color-muted);
    font-family: inherit;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 5px;
}

.icon-btn {
    align-items: center;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 11px;
    color: var(--color-secondary);
    display: inline-flex;
    height: 42px;
    justify-content: center;
    position: relative;
    transition: var(--transition);
    width: 42px;
}

.icon-btn:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
    color: var(--color-primary);
    transform: translateY(-1px);
}

.notification-dot {
    background: var(--color-danger);
    border: 2px solid var(--color-card);
    border-radius: 50%;
    height: 8px;
    position: absolute;
    right: 8px;
    top: 8px;
    width: 8px;
}

.user-menu {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: var(--radius-md);
    color: var(--color-text);
    display: flex;
    gap: 9px;
    min-height: 46px;
    padding: 4px 7px;
    transition: background var(--transition);
}

.user-menu:hover {
    background: #f1f5f9;
}

.user-avatar {
    align-items: center;
    background: linear-gradient(145deg, var(--color-primary), var(--color-accent));
    border-radius: 11px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 38px;
    font-size: 14px;
    font-weight: 700;
    height: 38px;
    justify-content: center;
}

.user-menu-copy {
    line-height: 1.15;
    max-width: 125px;
    text-align: left;
}

.user-menu-copy strong,
.user-menu-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-copy strong {
    font-size: 12px;
    font-weight: 700;
}

.user-menu-copy small {
    color: var(--color-muted);
    font-size: 10px;
    margin-top: 3px;
}

.dropdown-menu {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 8px !important;
    padding: 8px;
}

.dropdown-item {
    align-items: center;
    border-radius: 8px;
    display: flex;
    font-size: 13px;
    gap: 10px;
    padding: 9px 10px;
}

.dropdown-item:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.notification-menu {
    min-width: 280px;
}

.notification-empty {
    align-items: center;
    color: var(--color-muted);
    display: flex;
    flex-direction: column;
    padding: 24px 14px;
    text-align: center;
}

.notification-empty i {
    background: #f1f5f9;
    border-radius: 50%;
    color: var(--color-primary);
    font-size: 20px;
    margin-bottom: 10px;
    padding: 10px 13px;
}

.notification-empty strong {
    color: var(--color-text);
    font-size: 13px;
}

.notification-empty span {
    font-size: 11px;
}

.profile-menu {
    min-width: 245px;
}

.profile-menu-header {
    align-items: center;
    display: flex;
    gap: 10px;
    padding: 7px;
}

.profile-menu-header strong,
.profile-menu-header small {
    display: block;
}

.profile-menu-header small {
    color: var(--color-muted);
    font-size: 11px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-container {
    margin: 0 auto;
    max-width: 1680px;
    padding: 26px 30px 38px;
}

/* Cards and dashboard */
.card,
.stat-card,
.summary-box,
.modal-content {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card {
    overflow: hidden;
}

.card-header {
    background: var(--color-card) !important;
    border-bottom: 1px solid var(--color-border);
    min-height: 62px;
    padding: 17px 20px;
}

.card-header h2,
.card-header h3 {
    color: var(--color-text);
    font-weight: 700;
    letter-spacing: -0.015em;
}

.card-body {
    padding: 20px;
}

.card-footer {
    border-top: 1px solid var(--color-border);
    padding: 15px 20px;
}

.stat-card {
    height: 100%;
    min-height: 132px;
    overflow: hidden;
    padding: 20px;
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.stat-card::before {
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.1), transparent);
    border-radius: 50%;
    content: "";
    height: 110px;
    position: absolute;
    right: -38px;
    top: -42px;
    width: 110px;
}

.stat-card:hover {
    border-color: #bfdbfe;
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.stat-card span {
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.055em;
}

.stat-card strong {
    color: var(--color-text);
    font-size: clamp(24px, 2vw, 31px);
    font-weight: 750;
    letter-spacing: -0.035em;
    margin-top: 10px;
}

.stat-card-icon {
    align-items: center;
    background: var(--color-primary-soft);
    border-radius: 11px;
    color: var(--color-primary);
    display: flex;
    font-size: 18px;
    height: 40px;
    justify-content: center;
    margin-bottom: 14px;
    width: 40px;
}

.stat-card-meta {
    align-items: center;
    color: var(--color-muted);
    display: flex;
    font-size: 10px;
    gap: 5px;
    margin-top: 10px;
}

.stat-card-meta i {
    color: var(--color-success);
}

.summary-box {
    background: linear-gradient(155deg, #f8fafc, #fff);
    padding: 20px;
}

.summary-line {
    color: var(--color-muted);
    margin-bottom: 12px;
}

.summary-line strong {
    color: var(--color-text);
}

.summary-line.grand {
    border-top-color: var(--color-border);
    color: var(--color-text);
    font-size: 18px;
}

/* Buttons */
.btn {
    align-items: center;
    border-radius: 9px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 650;
    gap: 7px;
    justify-content: center;
    min-height: 40px;
    overflow: hidden;
    padding: 8px 15px;
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    border-radius: 8px;
    font-size: 11px;
    min-height: 32px;
    padding: 5px 10px;
}

.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

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

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

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

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

.btn-light {
    background: #f1f5f9;
    border-color: #f1f5f9;
    color: var(--color-secondary);
}

.btn-outline-primary {
    border-color: #bfdbfe;
    color: var(--color-primary);
}

.btn-outline-primary:hover {
    background: var(--color-primary-soft);
    border-color: #93c5fd;
    color: var(--color-primary-dark);
}

.btn-outline-secondary {
    border-color: var(--color-border);
    color: #475569;
}

.btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--color-secondary);
}

.btn-outline-danger {
    border-color: #fecaca;
    color: var(--color-danger);
}

.btn-outline-danger:hover {
    background: var(--color-danger-soft);
    border-color: #fca5a5;
    color: #dc2626;
}

.btn-outline-info {
    border-color: #bae6fd;
    color: #0284c7;
}

.btn-outline-info:hover {
    background: #f0f9ff;
    border-color: #7dd3fc;
    color: #0369a1;
}

.btn-loading {
    cursor: wait;
    opacity: 0.78;
    pointer-events: none;
}

.btn-ripple {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    pointer-events: none;
    position: absolute;
    transform: scale(0);
    animation: button-ripple 500ms linear;
}

/* Forms */
.form-label {
    color: #334155;
    font-size: 11px;
    font-weight: 650;
    margin-bottom: 7px;
}

.form-control,
.form-select {
    background-color: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    color: var(--color-text);
    font-size: 13px;
    min-height: 43px;
    padding: 10px 12px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

textarea.form-control {
    min-height: 100px;
}

.form-control[readonly],
.form-control:disabled,
.form-select:disabled {
    background-color: #f8fafc;
    color: var(--color-muted);
}

.form-text {
    color: var(--color-muted);
    font-size: 10px;
}

.form-check-input {
    border-color: #cbd5e1;
    height: 17px;
    width: 17px;
}

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

.ui-floating-field {
    padding-top: 7px;
    position: relative;
}

.ui-floating-field > .form-label {
    background: linear-gradient(#fff 70%, transparent 70%);
    color: var(--color-muted);
    left: 11px;
    line-height: 1;
    margin: 0;
    padding: 0 4px;
    position: absolute;
    top: 2px;
    z-index: 2;
}

.ui-floating-field:focus-within > .form-label {
    color: var(--color-primary);
}

.is-invalid,
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: var(--color-danger);
}

.invalid-feedback {
    color: var(--color-danger);
    font-size: 10px;
}

/* Tables and DataTables */
.table-responsive {
    border-radius: var(--radius-md);
}

.table {
    border-color: var(--color-border);
    color: var(--color-text);
    font-size: 12px;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--color-border);
    padding: 13px 14px;
    vertical-align: middle;
}

.table > thead {
    background: #f8fafc;
    color: #475569;
    position: sticky;
    top: 0;
    z-index: 2;
}

.table > thead th {
    border-bottom: 1px solid var(--color-border);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.065em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table > tbody > tr:nth-child(even) > * {
    background: #fbfdff;
}

.table-hover > tbody > tr:hover > * {
    background: var(--color-primary-soft);
    box-shadow: inset 3px 0 0 var(--color-primary);
}

.table .btn + .btn,
.table .btn + form,
.table form + .btn,
.table form + form {
    margin-left: 3px;
}

.dataTables_wrapper .row:first-child,
.dataTables_wrapper .row:last-child {
    align-items: center;
    gap: 10px 0;
    margin: 0;
    padding: 0 0 15px;
}

.dataTables_wrapper .row:last-child {
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
    padding: 15px 0 0;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 600;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--color-border);
    border-radius: 9px;
    box-shadow: none;
    font-size: 12px;
    min-height: 36px;
}

.dataTables_wrapper .dataTables_filter input {
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 11px center;
    margin-left: 8px;
    padding-left: 34px;
    width: 220px;
}

.dataTables_wrapper .dataTables_info {
    color: var(--color-muted);
    font-size: 11px;
    padding-top: 0;
}

.page-link {
    border: 0;
    border-radius: 8px !important;
    color: var(--color-muted);
    font-size: 11px;
    margin: 0 2px;
    min-width: 32px;
    text-align: center;
}

.page-item.active .page-link {
    background: var(--color-primary);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

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

.dataTables_empty,
.data-table-empty-fallback {
    color: var(--color-muted) !important;
    font-size: 12px;
    padding: 42px 20px !important;
}

.data-table-empty-fallback {
    align-items: center;
    background: linear-gradient(180deg, #fff, #f8fafc);
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 14px;
    text-align: center;
}

.data-table-empty-fallback i {
    align-items: center;
    background: var(--color-primary-soft);
    border-radius: 50%;
    color: var(--color-primary);
    display: flex;
    font-size: 20px;
    height: 46px;
    justify-content: center;
    margin-bottom: 6px;
    width: 46px;
}

.data-table-empty-fallback strong {
    color: var(--color-text);
    font-size: 13px;
}

.data-table-empty-fallback span {
    font-size: 11px;
}

.dataTables_wrapper + .data-table-empty-fallback {
    display: none;
}

/* Badges, alerts and modals */
.badge {
    border-radius: 999px;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.04em;
    padding: 6px 9px;
    text-transform: uppercase;
}

.badge.bg-success {
    background: var(--color-success-soft) !important;
    color: #15803d;
}

.badge.bg-warning {
    background: var(--color-warning-soft) !important;
    color: #b45309 !important;
}

.badge.bg-secondary {
    background: #f1f5f9 !important;
    color: #475569;
}

.badge.bg-danger {
    background: var(--color-danger-soft) !important;
    color: #dc2626;
}

.alert {
    align-items: center;
    border: 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    font-size: 12px;
    gap: 9px;
    padding: 13px 16px;
}

.alert-success {
    background: var(--color-success-soft);
    color: #166534;
}

.alert-danger {
    background: var(--color-danger-soft);
    color: #991b1b;
}

.alert-warning {
    background: var(--color-warning-soft);
    color: #92400e;
}

.modal-backdrop.show {
    opacity: 0.38;
}

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

.modal-header,
.modal-footer {
    border-color: var(--color-border);
    padding: 17px 20px;
}

.modal-body {
    padding: 22px 20px;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
}

/* Invoice and payment experiences */
.invoice-form {
    overflow: visible;
}

.invoice-form > .card-body {
    padding: 24px;
}

.invoice-section-heading {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.invoice-section-icon {
    align-items: center;
    background: var(--color-primary-soft);
    border-radius: 11px;
    color: var(--color-primary);
    display: flex;
    flex: 0 0 40px;
    font-size: 17px;
    height: 40px;
    justify-content: center;
}

.invoice-section-heading h2 {
    font-size: 15px;
    font-weight: 750;
    margin: 0;
}

.invoice-section-heading p,
.card-header-copy {
    color: var(--color-muted);
    font-size: 11px;
    margin-top: 2px;
}

#invoiceItemsTable {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

#invoiceItemsTable thead {
    background: var(--color-secondary);
    color: #fff;
}

#invoiceItemsTable thead th {
    color: #e2e8f0;
}

#invoiceItemsTable .form-control,
#invoiceItemsTable .form-select {
    min-height: 38px;
}

.invoice-product-column {
    min-width: 260px;
}

.invoice-stock-column {
    width: 120px;
}

.invoice-quantity-column {
    width: 130px;
}

.invoice-money-column {
    width: 150px;
}

.invoice-action-column {
    width: 80px;
}

.invoice-item-row.table-warning > * {
    background: var(--color-warning-soft) !important;
}

.invoice-item-row.table-warning input,
.invoice-item-row.table-warning select {
    border-color: var(--color-warning);
}

/* Create invoice contrast and readability */
.page-create-invoice .page-title {
    color: #0f172a;
    font-weight: 700;
}

.page-create-invoice .invoice-section-heading h2 {
    color: #111827;
    font-weight: 700;
}

.page-create-invoice .invoice-section-heading p {
    color: #64748b;
    font-weight: 500;
}

.page-create-invoice .form-label,
.page-create-invoice .ui-floating-field > .form-label {
    color: #334155;
    font-size: 14px;
    font-weight: 600;
}

.page-create-invoice .ui-floating-field:focus-within > .form-label {
    color: #1d4ed8;
}

.page-create-invoice .form-control,
.page-create-invoice .form-select,
.page-create-invoice .form-control[readonly],
.page-create-invoice .form-control:disabled,
.page-create-invoice .form-select:disabled {
    color: #0f172a;
    font-weight: 500;
    opacity: 1;
}

.page-create-invoice .form-select {
    background-color: #fff;
}

.page-create-invoice .form-control::placeholder,
.page-create-invoice textarea.form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.page-create-invoice #invoiceItemsTable thead {
    background: #f8fafc;
    color: #475569;
}

.page-create-invoice #invoiceItemsTable thead th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.page-create-invoice #invoiceItemsTable tbody td {
    color: #0f172a;
    font-weight: 500;
}

.page-create-invoice .summary-box {
    background: #fff;
    border-color: #cbd5e1;
}

.page-create-invoice .summary-box .form-label,
.page-create-invoice .summary-line {
    color: #334155;
    font-weight: 600;
}

.page-create-invoice .summary-line strong,
.page-create-invoice .summary-line.grand,
.page-create-invoice .summary-line.grand strong {
    color: #0f172a;
    font-weight: 700;
}

.page-payment-history .card:first-of-type,
.page-update-payment .card:first-of-type {
    background: linear-gradient(135deg, #fff, #f8fbff);
}

.section-kicker {
    align-items: center;
    color: var(--color-primary);
    display: inline-flex;
    font-size: 9px;
    font-weight: 750;
    gap: 5px;
    letter-spacing: 0.09em;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.payment-hero-card {
    overflow: visible;
}

.payment-hero-card .card-body {
    padding: 22px;
}

.payment-overview-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(100px, 1fr));
}

.payment-overview-item {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}

.payment-overview-item small,
.payment-overview-item strong {
    display: block;
}

.payment-overview-item small {
    color: var(--color-muted);
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.payment-overview-item strong {
    font-size: 15px;
    margin-top: 5px;
}

.payment-overview-due {
    background: var(--color-warning-soft);
    border-color: #fde68a;
}

.payment-overview-due strong {
    color: #b45309;
}

.payment-summary-card .card-body {
    background: linear-gradient(180deg, #fff, #fbfdff);
}

.payment-summary-identity {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px;
}

.payment-summary-identity p:last-child {
    margin-bottom: 0;
}

.payment-form-card .card-header {
    display: block;
}

.audit-count {
    background: var(--color-primary-soft);
    border-radius: 999px;
    color: var(--color-primary);
    font-size: 10px;
    font-weight: 700;
    padding: 6px 10px;
}

.payment-history-table tbody tr {
    position: relative;
}

.payment-history-table tbody td:first-child {
    color: var(--color-primary);
    font-weight: 700;
    padding-left: 28px;
    position: relative;
}

.payment-history-table tbody td:first-child::before {
    background: var(--color-primary);
    border: 4px solid #dbeafe;
    border-radius: 50%;
    content: "";
    height: 13px;
    left: 9px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
}

.payment-history-table tbody td.dataTables_empty::before {
    display: none;
}

.customer-assignment-list label {
    background: #fff;
    border-color: var(--color-border) !important;
    cursor: pointer;
    transition: var(--transition);
}

.customer-assignment-list label:hover {
    background: var(--color-primary-soft);
    border-color: #bfdbfe !important;
    transform: translateY(-1px);
}

/* Authentication */
.auth-body {
    background:
        radial-gradient(circle at 12% 20%, rgba(37, 99, 235, 0.12), transparent 28%),
        radial-gradient(circle at 88% 80%, rgba(14, 165, 233, 0.1), transparent 28%),
        var(--color-background);
}

.auth-card {
    border-color: rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 430px;
    padding: 38px;
}

.auth-card h1 {
    color: var(--color-text);
    font-weight: 750;
    letter-spacing: -0.025em;
}

.auth-card .auth-mark {
    height: 54px;
    margin-bottom: 16px;
    width: 54px;
}

.settings-logo {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 8px;
}

/* Global typography and contrast system */
.page-title,
.auth-card h1 {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-title);
}

.page-container h2,
.page-container h3,
.page-container h4,
.modal-title {
    color: #111827;
    font-weight: var(--font-weight-title);
}

.card-header h2,
.card-header h3,
.card-title {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-label);
}

.card,
.card-body,
.modal-body,
.dropdown-menu,
.auth-card {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-body);
}

.page-container p,
.page-container li,
.modal-body p,
.dropdown-item,
.form-check-label {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-body);
}

.page-container .text-muted,
.modal-content .text-muted,
.auth-card .text-muted,
.card-header-copy,
.form-text,
.dataTables_info,
.dataTables_empty,
.data-table-empty-fallback {
    color: var(--color-muted) !important;
    opacity: 1;
}

.form-label,
.ui-floating-field > .form-label {
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: var(--font-weight-label);
}

.ui-floating-field:focus-within > .form-label {
    color: var(--color-primary-dark);
}

.form-control,
.form-select,
.dataTables_wrapper input,
.dataTables_wrapper select {
    background-color: #fff;
    color: var(--color-text-primary);
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-body);
}

.form-control::placeholder,
textarea.form-control::placeholder,
.dataTables_wrapper input::placeholder,
.header-search input::placeholder {
    color: var(--color-placeholder);
    opacity: 1;
}

.form-control[readonly],
.form-control:disabled,
.form-select:disabled {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-body);
    opacity: 1;
}

.form-select option {
    background: #fff;
    color: var(--color-text-primary);
    font-weight: var(--font-weight-body);
}

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

.table > thead,
.table > thead > tr > *,
.page-create-invoice #invoiceItemsTable thead,
.page-create-invoice #invoiceItemsTable thead th {
    background: var(--color-table-header);
    background-color: var(--color-table-header);
    color: var(--color-text-secondary);
}

.table > thead th,
.page-create-invoice #invoiceItemsTable thead th {
    font-weight: var(--font-weight-title);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.table > tbody > tr > * {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-body);
}

.table > tbody > tr > * .text-muted {
    color: var(--color-muted) !important;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_info,
.page-link {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-body);
}

.btn {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-label);
}

.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.btn-secondary,
.btn-light {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-light:hover,
.btn-light:focus {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-danger {
    background: var(--color-danger-accessible);
    border-color: var(--color-danger-accessible);
    color: #fff;
}

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

.btn-warning {
    color: #1e293b;
}

.btn-warning:hover,
.btn-warning:focus {
    color: #0f172a;
}

.btn-outline-secondary {
    background: #fff;
    border-color: #cbd5e1;
    color: #1e293b;
}

.btn-outline-danger {
    background: #fff;
    border-color: #ef4444;
    color: #dc2626;
}

.badge {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-title);
}

.badge.bg-success {
    background: #dcfce7 !important;
    color: #15803d !important;
}

.badge.bg-secondary {
    background: #fef3c7 !important;
    color: #b45309 !important;
}

.badge.bg-warning,
.badge.bg-warning.text-dark {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
}

.badge.bg-danger {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

.summary-line,
.payment-overview-item small,
.stat-card span,
.stat-card-meta {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-body);
}

.summary-line strong,
.payment-overview-item strong,
.stat-card strong {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-title);
}

.dropdown-item {
    color: var(--color-text-secondary);
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--color-primary-dark);
}

/* Motion */
.page-container > * {
    animation: fade-up 280ms ease both;
}

.page-container > *:nth-child(2) {
    animation-delay: 45ms;
}

.page-container > *:nth-child(3) {
    animation-delay: 90ms;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes button-ripple {
    to { opacity: 0; transform: scale(4); }
}

/* Responsive */
@media (max-width: 1199.98px) {
    .header-search {
        width: 205px;
    }

    .user-menu-copy {
        display: none;
    }

    .payment-overview-grid {
        grid-template-columns: repeat(2, minmax(100px, 1fr));
    }
}

@media (max-width: 991.98px) {
    .sidebar,
    .sidebar-collapsed .sidebar {
        padding: 18px 16px;
        transform: translateX(-100%);
        width: min(86vw, 290px);
    }

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

    body.sidebar-mobile-open {
        overflow: hidden;
    }

    .sidebar-mobile-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-collapsed .brand-copy,
    .sidebar-collapsed .nav-link span,
    .sidebar-collapsed .nav-section-label,
    .sidebar-collapsed .sidebar-footer-copy {
        display: block;
    }

    .sidebar-collapsed .sidebar .nav-link {
        justify-content: flex-start;
        padding: 10px 12px;
    }

    .content,
    .sidebar-collapsed .content {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        align-items: center;
        flex-direction: row;
        padding: 13px 20px;
    }

    .page-subtitle,
    .page-breadcrumb {
        display: none;
    }

    .page-title {
        font-size: 21px;
    }

    .header-search {
        width: 180px;
    }

    .page-container {
        padding: 22px 20px 32px;
    }
}

@media (max-width: 767.98px) {
    .topbar {
        min-height: 72px;
        padding: 10px 14px;
    }

    .topbar-actions {
        margin-left: auto;
    }

    .header-search {
        display: none;
    }

    .notification-btn {
        display: none;
    }

    .page-container {
        padding: 16px 14px 28px;
    }

    .card-header,
    .card-body,
    .invoice-form > .card-body {
        padding-left: 15px;
        padding-right: 15px;
    }

    .card-header {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 10px;
    }

    .card-header .btn {
        width: 100%;
    }

    .stat-card {
        min-height: 120px;
    }

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        text-align: left !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        margin-left: 0;
        margin-top: 6px;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_paginate {
        margin-top: 10px;
        text-align: left !important;
    }

    .table-responsive {
        margin: 0 -15px;
        padding: 0 15px;
    }

    .table > :not(caption) > * > * {
        padding: 11px 12px;
        white-space: nowrap;
    }

    .payment-overview-grid {
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .auth-card {
        padding: 28px 22px;
    }
}

@media (max-width: 479.98px) {
    .user-menu > .bi-chevron-down {
        display: none;
    }

    .page-title {
        max-width: 190px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .payment-overview-grid {
        grid-template-columns: 1fr;
    }

    .btn:not(.btn-sm) {
        min-height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media print {
    .sidebar,
    .sidebar-overlay,
    .topbar,
    .no-print,
    .dataTables_length,
    .dataTables_filter,
    .dataTables_info,
    .dataTables_paginate,
    .btn {
        display: none !important;
    }

    .content,
    .sidebar-collapsed .content {
        margin: 0;
        width: 100%;
    }

    .page-container {
        max-width: none;
        padding: 0;
    }

    .card {
        border: 0;
        box-shadow: none;
    }
}
