:root {
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --text-primary: #1C274C;
    --text-secondary: #1C274C;
    --text-muted: #888;
    --border-color: #ddd;
    --border-light: #eee;
    --border-input: #ccc;
    --accent-color: #1C274C;
    --text-white: #fff;
    --btn-secondary-bg: #f8f9fc;
    --btn-secondary-hover: #d0d0d0;
    --btn-primary-hover: #008f72;
    --toast-bg: #333;
    --overlay-bg: rgba(0, 0, 0, 0.4);
    --confirm-bg: rgba(255, 255, 255, 0.15);
    --confirm-border: rgba(255, 255, 255, 0.2);
    --confirm-btn-secondary-bg: rgba(255, 255, 255, 0.2);
    --confirm-btn-secondary-hover: rgba(255, 255, 255, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --red: #dc3545;
    --green: #28a745;
    --blue: #007bff;
    --blue-hover: #0056b3;
    --hover: #f8f9fc;

    --bg-sidebar: var(--bg-card);
    --bg-dropdown: var(--bg-card);
    --bg-hover: #f0f2f5;
    --modal-bg: var(--overlay-bg);
    --modal-card-bg: var(--bg-card);
    --option-border: var(--border-color);
    --option-selected-border: var(--accent-color);
    --option-hover-bg: #f7f7f7;
    --sidebar-width: 220px;
    --bg-scrollbar-track: #f0f0f0;
    --bg-scrollbar-thumb: #c1c1c1;
    --bg-scrollbar-thumb-hover: #a8a8a8;
    --bottom-nav-height: 68px;
    --amber: #d99b3f;
    --bg-stripe: #f8f9fc;
    --staff-dropdown-bg: var(--bg-card);
    --staff-dropdown-text: var(--text-primary);
    --staff-dropdown-hover: var(--bg-hover);
    --staff-dropdown-border: var(--border-input);
    --staff-dropdown-radius: 0;
    --staff-dropdown-shadow: var(--shadow-md);
    --staff-dropdown-item-padding: 0.5rem 1.2rem;
    --staff-dropdown-item-font: 0.8rem;
    --staff-dropdown-item-icon: 1rem;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Mono', monospace;
    background-color: var(--bg-body) !important;
    color: #1a1a1a;
    min-height: 100vh;
    overscroll-behavior-y: none;
}

.container {
    width: 80%;
    background: var(--bg-card);
    padding: 2rem;
    margin: 120px auto 0;
}

.acc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.acc-header h1 {
    font-size: 1.8rem;
    font-weight: 500;
}

.acc-header .logout {
    color: #d32f2f !important;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.acc-header .logout:hover {
    text-decoration: underline;
}

.auth-box {
    max-width: 420px;
    margin: 0 auto;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid #eaeef2;
    margin-bottom: 1.5rem;
}

.auth-tabs button {
    background: none;
    border: none;
    padding: 0.8rem 1.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    color: #888;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.auth-tabs button.active {
    color: #000;
    border-bottom-color: #000;
}

.auth-form {
    display: block;
}

.auth-form.hidden {
    display: none;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: #444;
    margin: 10px 0 10px !important;
}

.form-group input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid #dce1e6;
    font-family: inherit;
    font-size: 16px;
    background: #fafcfc;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus {
    outline: none;
    border-color: #000;
    background: #fff;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 2.8rem;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 1.1rem;
    padding: 0.5rem;
    transition: color 0.2s;
    border-radius: 50%;
}

.password-toggle:hover {
    color: #000;
}

.btn {
    padding: 0.7rem 1.5rem;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    touch-action: manipulation;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn:hover {
    background: #1a1a1a;
}

.btn:active {
    transform: scale(0.98);
}

.btn-ghost {
    background: #f8f9fa;
    color: #000;
    border-color: #ccc;
}

.btn-ghost:hover {
    background: #eef0f3;
}

.btn-danger {
    background: #d32f2f;
    border-color: #d32f2f;
    color: #fff;
}

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

.btn-secondary {
    background: #f8f9fa;
    color: #000;
    border: 1px solid #ccc;
}

.btn-secondary:hover {
    background: #eef0f3;
}

.btn-primary {
    background: #047857;
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: #065f46;
}

.btn-link {
    background: none;
    border: none;
    color: #000;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0;
    margin-top: 0.5rem;
    display: inline-block;
}

.btn-link:hover {
    color: #555;
}

.error {
    color: #d32f2f;
    background: #fff1f0;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #d32f2f;
}

.success {
    color: #1d8b4f;
    background: #e6f7ed;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #1d8b4f;
}

.otp-container {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin: 1.2rem 0;
}

.otp-container input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.4rem;
    font-family: inherit;
    border: 1.5px solid #dce1e6;
    background: #fafcfc;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.otp-container input:focus {
    outline: none;
    border-color: #000;
    background: #fff;
}

.otp-container input.is-filled {
    border-color: #000;
}

.profile-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 140px;
    height: 140px;
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    font-weight: 500;
    flex-shrink: 0;
    border-radius: 50%;
}

.profile-info h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.profile-meta {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 0.5rem 1.2rem;
    font-size: 0.8rem;
    color: #555;
}

.profile-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin: 10px 0 10px !important;
}

.profile-meta svg {
    flex-shrink: 0;
}

.status-badge {
    display: inline-block;
    padding: 0.15rem 0.8rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #e2e3e5;
    color: #383d41;
}

.status-badge.blacklisted {
    background: #f8d7da;
    color: #721c24;
}

.stats-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.stat-mini {
    background: transparent !important;
    padding: 0.8rem 1rem;
    text-align: center;
    border: 1px solid #eaeef2;
}

.stat-mini .label {
    font-size: 18px;
    color: var(--accent-color);
    text-transform: capitalize;
    letter-spacing: 0.03em;
    opacity: 0.6;
    margin-bottom: 10px;
}

.stat-mini .value {
    font-size: 20px;
    font-weight: 500;
}

.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.8rem 1.5rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 400 !important;
    color: var(--accent-color);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: #000;
    border-bottom-color: #000;
}

.tab-content {
    display: none;
}

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

.card {
    background: #fff;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #eaeef2;
}

.card h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 25px !important;
    font-weight: 500 !important;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    align-items: baseline;
}

.detail-label {
    font-weight: 500 !important;
    color: #555;
    flex-shrink: 0;
    margin-right: 2rem;
}

.detail-value {
    color: #1a1a1a;
    text-align: right;
    word-break: break-word;
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.table-container th {
    background: #000;
    color: #fff;
    font-weight: 500;
    padding: 0.6rem 0.8rem;
    text-align: left;
    border: 1px solid #eee;
}

.table-container td {
    padding: 0.5rem 0.8rem;
    border: 1px solid #eee;
    vertical-align: middle;
}

.table-container tr:hover {
    background: #f8f8f8;
}

.status {
    display: inline-block;
    font-size: 14px;
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

.status.pending {
    color: #856404;
}

.status.paid {
    color: #155724;
}

.status.unpaid {
    color: #721c24;
}

.status.partial {
    color: #0c5460;
}

.status.completed {
    color: #155724;
}

.status.shipped {
    color: #0c5460;
}

.status.processing {
    color: #856404;
}

.status.cancelled {
    color: #721c24;
}

.status.draft {
    color: #383d41;
}

.status.sent {
    color: #0c5460;
}

.status.accepted {
    color: #155724;
}

.status.rejected {
    color: #721c24;
}

.status.expired {
    color: #383d41;
}

.status.converted {
    color: #155724;
}

.btn-sm {
    padding: 0.2rem 0.8rem;
    font-size: 0.7rem;
}

.btn-view {
    background: #007bff;
    color: #fff;
    border: none;
    cursor: pointer;
}

.btn-view:hover {
    background: #0056b3;
}

.toast {
    position: fixed;
    bottom: calc(2rem + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    padding: 0.8rem 2rem;
    background: #333;
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 4000;
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    width: 80%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    -webkit-overflow-scrolling: touch;
}

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

.modal-close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #888;
    font-family: inherit;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 1;
}

.modal-close:hover {
    color: #000;
    background: #f3f4f6;
}

.modal-box h2 {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.modal-box .subtitle {
    color: #666;
    margin-bottom: 1.5rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-right: 2.5rem;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.modal-header .modal-close {
    top: 0.6rem;
    right: 0.6rem;
}

.modal-body {
    padding-bottom: 0.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    margin-top: 1rem;
}

.modal-section-title {
    margin-top: 1.5rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.modal-items-table {
    margin-top: 0.6rem;
}

.acct-type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.acct-type-toggle input {
    display: none;
}

.acct-type-toggle label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.8rem 0.5rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.82rem;
    color: #666;
    transition: all .15s ease;
    background: #fff;
    -webkit-tap-highlight-color: transparent;
    min-height: 60px;
    justify-content: center;
}

.acct-type-toggle label i {
    font-size: 1.05rem;
}

.acct-type-toggle label:hover {
    border-color: #bbb;
}

.acct-type-toggle input:checked+label {
    border-color: #111;
    color: #111;
    background: #f5f5f5;
}

.acct-type-fields {
    display: none;
}

.acct-type-fields.active {
    display: block;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem 1rem;
}

.form-grid-2 .form-group {
    margin-bottom: 0;
}

.form-grid-2 .span-2 {
    grid-column: 1 / -1;
}

.form-grid-2 .section-heading {
    margin-top: 20px;
    font-weight: 600;
    color: var(--accent-color);
    padding-top: 1rem;
    border-top: 1px solid #eaeef2;
}

.form-actions {
    margin-top: 1.2rem;
    display: flex;
    justify-content: flex-end;
}

.btn-save {
    width: auto;
    padding: 0.7rem 2rem;
}

.profile-banner {
    background: #fff8e1;
    border: 1px solid #ffe082;
    color: #6d4c00;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.profile-banner button {
    background: #111;
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    min-height: 40px;
    font-family: inherit;
}

.row-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.row-actions button {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 36px;
    min-height: 36px;
    justify-content: center;
}

.row-actions button:hover {
    background: #f3f4f6;
}

.row-actions button.primary {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.row-actions button.success {
    background: #047857;
    color: #fff;
    border-color: #047857;
}

.row-actions button.success:hover {
    background: #065f46;
}

.row-actions button:disabled {
    opacity: .55;
    cursor: default;
}

.table-container thead th:last-child {
    text-align: right;
}

.table-container tbody td:last-child {
    text-align: right;
}

.table-container tbody td:last-child .row-actions {
    justify-content: flex-end;
}

.table-filters {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin: 20px 0 20px;
    background: transparent;
    align-items: center;
}

.filter-search {
    flex: 1 1 220px;
    position: relative;
    min-width: 180px;
}

.filter-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.78rem;
    pointer-events: none;
}

.filter-search input {
    width: 100%;
    padding: 9px 10px 9px 32px;
    border: 1px solid #d1d5db;
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
    outline: none;
    min-height: 40px;
}

.filter-search input:focus {
    border-color: #111827;
}

.table-filters input.filter-range {
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
    color: #374151;
    outline: none;
    cursor: pointer;
    min-height: 40px;
}

.table-filters input.filter-range {
    width: 210px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.table-filters input.filter-range:focus {
    border-color: #111827;
}

.table-filters .clear-filters {
    padding: 9px 14px;
    background: transparent;
    border: 1px solid #d1d5db;
    font-size: 0.82rem;
    cursor: pointer;
    color: #374151;
    font-family: inherit;
    min-height: 40px;
}

.table-filters .clear-filters:hover {
    background: #eef0f3;
}

.custom-select {
    position: relative;
    width: 145px;
    user-select: none;
}

.custom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s;
    line-height: 1.4;
    min-height: 40px;
}

.custom-select-trigger:hover {
    border-color: #9ca3af;
}

.custom-select.open .custom-select-trigger {
    border-color: #111827;
}

.custom-select-value {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-arrow {
    flex-shrink: 0;
    color: #6b7280;
    transition: transform 0.2s;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    list-style: none;
    padding: 4px 0;
    margin: 0;
}

.custom-select.open .custom-select-options {
    display: block;
}

.custom-select-option {
    padding: 10px 12px;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
    transition: background 0.1s;
    list-style: none;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.custom-select-option:hover {
    background: #f3f4f6;
}

.custom-select-option.selected {
    background: #111827;
    color: #fff;
    font-weight: 500;
}

.custom-select-option.selected:hover {
    background: #111827;
}

.table-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.table-pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.table-pagination button:hover:not(:disabled):not(.active) {
    background: #eef0f3;
}

.table-pagination button.active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.table-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.table-pagination .dots {
    border: none;
    background: transparent;
    cursor: default;
    color: #9ca3af;
    letter-spacing: 1px;
}

.table-pagination .dots:hover {
    background: transparent;
}

.table-count {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.6rem;
    text-align: center;
}

.table-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.flatpickr-calendar {
    background: #fff;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    padding: 12px 10px 8px;
    width: 272px;
    margin-top: 6px;
}

.flatpickr-calendar.rangeMode {
    width: 272px;
}

.flatpickr-calendar:before,
.flatpickr-calendar:after {
    display: none;
}

.flatpickr-months {
    padding: 0 2px 6px;
    position: relative;
}

.flatpickr-months .flatpickr-month {
    color: #111827;
    height: 30px;
    overflow: visible;
}

.flatpickr-current-month {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    padding-top: 5px;
    padding-left: 0;
    text-align: left;
    left: 4px;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-weight: 700;
    background: transparent;
    color: #111827;
    padding: 0;
    margin-right: 2px;
    appearance: none;
    -webkit-appearance: none;
    text-align: left;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: transparent;
}

.flatpickr-current-month .numInputWrapper {
    width: 60px;
}

.flatpickr-current-month .numInputWrapper span.arrowUp,
.flatpickr-current-month .numInputWrapper span.arrowDown {
    display: none;
}

.flatpickr-current-month input.cur-year {
    font-weight: 700;
    color: #111827;
    padding: 0;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    top: 2px;
    padding: 6px;
    border-radius: 6px;
    color: #111827;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    background: #f3f4f6;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: #111827;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    width: 12px;
    height: 12px;
    fill: #111827;
}

.flatpickr-weekdays {
    padding: 4px 0 4px;
    height: auto;
}

.flatpickr-weekday {
    color: #9ca3af;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: transparent;
}

.flatpickr-innerContainer {
    padding: 0 2px;
}

.flatpickr-days {
    width: 100%;
}

.dayContainer {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
}

.flatpickr-day {
    color: #111827;
    font-size: 13px;
    font-weight: 500;
    border-radius: 50%;
    max-width: 33px;
    height: 33px;
    line-height: 33px;
    border: none;
    flex-basis: 14.28%;
    margin: 0;
}

.flatpickr-day.today {
    color: #3b82f6;
    background: transparent;
    border: none;
    font-weight: 600;
}

.flatpickr-day.today:hover,
.flatpickr-day:hover {
    background: #f3f4f6;
    border: none;
    color: #111827;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
    background: #111827;
    color: #fff;
    border: none;
    font-weight: 600;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #d1d5db;
    font-weight: 400;
}

.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: transparent;
    color: #d1d5db;
}

.flatpickr-day.inRange {
    background: #e5e7eb;
    box-shadow: -5px 0 0 #e5e7eb, 5px 0 0 #e5e7eb;
    color: #111827;
    border-radius: 0;
}

.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #111827;
    color: #fff;
    border-radius: 50%;
    box-shadow: none;
}

.flatpickr-day.startRange.inRange {
    box-shadow: 5px 0 0 #e5e7eb;
}

.flatpickr-day.endRange.inRange {
    box-shadow: -5px 0 0 #e5e7eb;
}

.flatpickr-day.startRange.endRange {
    box-shadow: none;
}

.doc-toast {
    position: fixed;
    bottom: calc(24px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #111827;
    color: #fff;
    padding: 12px 20px;
    font-size: 13px;
    opacity: 0;
    transition: all .25s ease;
    z-index: 9999;
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}

.doc-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.doc-toast.success {
    background: #065f46;
}

.doc-toast.error {
    background: #991b1b;
}

.qorder-quote-title {
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 0.6rem;
}

.qorder-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    font-size: 0.85rem;
}

.qorder-summary .row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.qorder-summary .row.total {
    padding-top: 6px;
    border-top: 1px solid #e5e7eb;
    font-weight: 700;
    color: #111827;
    font-size: 0.95rem;
}

.qorder-summary .row.prev {
    color: #6b7280;
    font-size: 0.78rem;
    justify-content: flex-end;
}

.qorder-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.qorder-table th {
    text-align: left;
    padding: 8px 6px;
    font-weight: 600;
    color: #6b7280;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e7eb;
}

.qorder-table th.num,
.qorder-table td.num {
    text-align: right;
}

.qorder-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.qorder-table tr.changed {
    background: #fffbeb;
}

.qorder-table tr.missing {
    background: #fef2f2;
}

.qorder-old {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 0.75rem;
}

.qorder-new {
    color: #111827;
    font-weight: 600;
}

.qorder-new.up {
    color: #b91c1c;
}

.qorder-new.down {
    color: #047857;
}

.qorder-diff {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.qorder-diff.up {
    color: #b91c1c;
}

.qorder-diff.down {
    color: #047857;
}

.qorder-warning {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 10px 12px;
    margin-bottom: 1rem;
    font-size: 0.83rem;
    line-height: 1.4;
}

.qorder-warning.warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
}

.qorder-warning.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}

.qorder-warning i {
    margin-top: 2px;
}

.qorder-disabled-msg {
    font-size: 0.78rem;
    color: #991b1b;
    text-align: center;
    margin-top: 0.5rem;
}

#quoteOrderModal .modal-box {
    max-width: 640px;
}

.doc-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.doc-btn {
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    min-height: 48px;
    font-family: inherit;
    border: 1px solid transparent;
    width: 100%;
}

.doc-btn-dark {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.doc-btn-dark:hover {
    background: #1f2937;
}

.doc-btn-light {
    background: #fff;
    color: #111827;
    border-color: #d1d5db;
}

.doc-btn-light:hover {
    background: #f3f4f6;
}

.doc-btn-full {
    grid-column: 1 / -1;
}

.doc-email-status {
    margin-top: 0.9rem;
    font-size: 0.82rem;
    color: #6b7280;
    text-align: center;
}

.doc-modal-error {
    display: none;
    color: #991b1b;
    padding: 0.5rem 0;
    word-break: break-word;
    font-size: 0.85rem;
}

.logout-text {
    margin-bottom: 1.5rem;
}

.logout-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.logout-actions .btn {
    width: auto;
    padding: 0.6rem 1.5rem;
    min-width: 100px;
}

.account-header-section {
    width: 100%;
    height: 100px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 5%;
    padding-right: 5%;
}

.acc-back-btn {
    display: flex;
    align-items: center;
    gap: 10px;
}

.acc-back-btn a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f4f6f8 !important;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-md) !important;
}

.acc-back-btn a:hover {
    transform: translateX(-3px);
}

.print-action-container {
    max-width: 500px !important;
}

.quote-order-btn {
    padding: 8px !important;
    background-color: transparent !important;
    border: none !important;
    color: var(--accent-color) !important;
}

.view-detail-btn {
    border: none !important;
}

.doc-action-btn {
    background-color: transparent !important;
    border: none !important;
    color: var(--accent-color) !important;
}

.mobile-bottom-nav {
    display: none;
}

@media (max-width: 992px) {
    .container {
        width: 92%;
        padding: 1.5rem;
    }

    .modal-box {
        width: 90%;
    }
}

@media (max-width: 768px) {

    body.is-logged-in {
        padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 8px);
    }

    .container {
        width: 100%;
        margin: 0;
        padding: 1rem;
        padding-top: calc(88px + var(--safe-top));
        background: transparent;
    }

    body.is-guest .container {
        padding-top: calc(100px + var(--safe-top));
        background: var(--bg-card);
    }

    .account-header-section {
        height: auto;
        padding: 14px 16px;
        padding-top: calc(14px + var(--safe-top));
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .acc-header {
        margin-bottom: 1rem;
    }

    .acc-header h1 {
        font-size: 1.4rem;
    }

    .profile-banner {
        font-size: 0.85rem;
        padding: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .profile-banner button {
        width: 100%;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        margin-bottom: 1.25rem;
        padding: 1.25rem 1rem;
        background: var(--bg-card);
        border: 1px solid #eaeef2;
    }

    .profile-avatar {
        width: 84px;
        height: 84px;
        font-size: 32px;
    }

    .profile-info h2 {
        font-size: 1.25rem;
    }

    .profile-meta {
        justify-content: center;
        font-size: 0.78rem;
        gap: 0.4rem 1rem;
    }

    .profile-meta span {
        margin: 0 !important;
        justify-content: center;
    }

    .profile-meta svg {
        width: 16px;
        height: 16px;
    }

    .stats-mini {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        margin-bottom: 1.25rem;
        padding-bottom: 0.25rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .stats-mini::-webkit-scrollbar {
        display: none;
    }

    .stat-mini {
        flex: 0 0 auto;
        min-width: 130px;
        padding: 0.7rem 0.9rem;
        background: var(--bg-card) !important;
        scroll-snap-align: start;
    }

    .stat-mini .label {
        font-size: 11px;
        margin-bottom: 6px;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .stat-mini .value {
        font-size: 16px;
    }

    .tabs {
        display: none;
    }

    .tab-content {
        padding-bottom: 0.5rem;
    }

    .card {
        padding: 1rem;
        margin-bottom: 0;
        border: none;
        border-top: 1px solid #eaeef2;
    }

    .card h3 {
        font-size: 1.15rem !important;
        margin-bottom: 0.5rem;
        padding-bottom: 0.6rem;
        border-bottom: 1px solid #eaeef2;
    }

    .detail-row {
        padding: 0.7rem 0;
        border-bottom: 1px solid #f1f3f6;
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
    }

    .detail-row:last-child {
        border-bottom: none;
    }

    .detail-label {
        margin-right: 0;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #6b7280;
    }

    .detail-value {
        text-align: left;
        font-size: 0.92rem;
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
        padding: 0.85rem 0.9rem;
        min-height: 48px;
    }

    .form-group label {
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #6b7280;
        margin: 4px 0 6px !important;
    }

    .form-actions {
        position: sticky;
        bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 8px);
        background: var(--bg-card);
        padding: 0.75rem 0;
        margin: 1rem -1rem 0;
        padding-left: 1rem;
        padding-right: 1rem;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
        z-index: 5;
    }

    .btn-save {
        width: 100%;
        padding: 0.9rem 2rem;
        min-height: 48px;
    }

    .acct-type-toggle {
        gap: 0.5rem;
    }

    .acct-type-toggle label {
        padding: 0.9rem 0.5rem;
        font-size: 0.85rem;
        min-height: 68px;
    }

    .table-filters {
        gap: 0.5rem;
        margin: 0.75rem 0 1rem;
    }

    .filter-search {
        flex: 1 1 100%;
        min-width: 0;
    }

    .filter-search input {
        min-height: 44px;
    }

    .custom-select {
        flex: 1 1 calc(50% - 0.25rem);
        width: auto;
        min-width: 0;
    }

    .custom-select-trigger {
        min-height: 44px;
    }

    .table-filters input.filter-range {
        flex: 1 1 100%;
        width: auto;
        min-height: 44px;
    }

    .clear-filters {
        flex: 1 1 100%;
        width: 100%;
        min-height: 44px;
    }

    .table-container {
        overflow: visible;
    }

    .table-container table,
    .table-container thead,
    .table-container tbody,
    .table-container tr,
    .table-container td {
        display: block;
        width: 100%;
    }

    .table-container thead {
        display: none;
    }

    .table-container tbody tr {
        border: 1px solid #eaeef2;
        background: #fff;
        padding: 0.85rem 0.9rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    }

    .table-container tbody tr:hover {
        background: #fff;
    }

    .table-container tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px dashed #f1f3f6;
        font-size: 0.86rem;
        text-align: right !important;
    }

    .table-container tbody td:last-child {
        border-bottom: none;
        padding-top: 0.6rem;
        text-align: left !important;
    }

    .table-container tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-right: 1rem;
        text-align: left;
        flex-shrink: 0;
    }

    .table-container tbody td.no-label::before {
        display: none;
    }

    .table-container tbody td.no-label {
        display: block;
        padding-top: 0.75rem;
        margin-top: 0.25rem;
        border-top: 1px solid #f1f3f6;
    }

    .table-container tbody td.table-empty {
        display: block;
        text-align: center !important;
        padding: 2rem 1rem;
        border: none;
    }

    .table-container tbody td.table-empty::before {
        display: none;
    }

    .row-actions {
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .table-container tbody td:last-child .row-actions {
        justify-content: flex-start;
    }

    .row-actions button {
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
        font-size: 12px;
        border-radius: 8px;
    }

    .row-actions button svg {
        width: 20px;
        height: 20px;
    }

    .table-pagination {
        margin-top: 1.25rem;
    }

    .table-pagination button {
        min-width: 40px;
        height: 40px;
    }

    .table-count {
        margin-top: 0.75rem;
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(var(--bottom-nav-height) + var(--safe-bottom));
        padding-bottom: var(--safe-bottom);
        background: #fff;
        border-top: 1px solid #eaeef2;
        z-index: 2500;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    }

    .mob-nav-btn {
        flex: 1;
        background: none;
        border: none;
        font-family: inherit;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        cursor: pointer;
        color: #6b7280;
        font-size: 0.68rem;
        font-weight: 500;
        letter-spacing: 0.02em;
        padding: 0.5rem 0.25rem;
        position: relative;
        transition: color 0.15s;
        -webkit-tap-highlight-color: transparent;
        min-height: 48px;
    }

    .mob-nav-btn i {
        font-size: 1.15rem;
        margin-bottom: 1px;
    }

    .mob-nav-btn.active {
        color: #111827;
    }

    .mob-nav-btn.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 28px;
        height: 3px;
        background: #111827;
    }

    .mob-nav-btn:active {
        background: #f3f4f6;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-box {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        padding: 1.25rem 1.1rem;
        padding-bottom: calc(1.25rem + var(--safe-bottom));
        border-radius: 20px 20px 0 0;
        animation: slideUpSheet 0.28s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
    }

    .modal-box::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: #d1d5db;
    }

    .modal-box-sm {
        max-width: 100%;
    }

    .modal-box h2 {
        font-size: 1.2rem;
    }

    .modal-header {
        padding-top: 0.5rem;
        padding-right: 2.5rem;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    .modal-footer {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        width: 100%;
        min-height: 48px;
    }

    .modal-section-title {
        font-size: 0.9rem;
    }

    .modal-items-table tbody td::before {
        font-size: 0.68rem;
    }

    .logout-actions {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .logout-actions .btn {
        width: 100%;
        min-height: 48px;
    }

    .doc-actions-grid {
        gap: 0.5rem;
    }

    .doc-btn {
        min-height: 52px;
        font-size: 0.9rem;
    }

    .qorder-table {
        display: block;
    }

    .qorder-table thead {
        display: none;
    }

    .qorder-table tbody,
    .qorder-table tr,
    .qorder-table td {
        display: block;
        width: 100%;
    }

    .qorder-table tbody tr {
        border: 1px solid #eaeef2;
        padding: 0.75rem 0.85rem;
        margin-bottom: 0.6rem;
        background: #fff;
    }

    .qorder-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.35rem 0;
        border: none;
        text-align: right !important;
        font-size: 0.85rem;
    }

    .qorder-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        text-align: left;
    }

    .qorder-warning {
        font-size: 0.8rem;
    }

    .qorder-summary {
        font-size: 0.83rem;
    }

    .otp-container {
        gap: 0.4rem;
    }

    .otp-container input {
        width: 100%;
        max-width: 48px;
        height: 52px;
        font-size: 1.25rem;
        min-width: 0;
        flex: 1;
    }

    .auth-box {
        max-width: 100%;
        padding: 0 0.25rem;
    }

    .auth-tabs button {
        padding: 0.85rem 1.25rem;
        font-size: 0.9rem;
        flex: 1;
    }

    .btn {
        min-height: 48px;
        font-size: 0.95rem;
    }
}

@media (max-width: 420px) {
    .container {
        padding: 0.75rem;
        padding-top: calc(84px + var(--safe-top));
    }

    .stat-mini {
        min-width: 118px;
        padding: 0.6rem 0.8rem;
    }

    .profile-avatar {
        width: 72px;
        height: 72px;
        font-size: 28px;
    }

    .profile-info h2 {
        font-size: 1.15rem;
    }

    .card h3 {
        font-size: 1.05rem !important;
    }

    .doc-btn {
        font-size: 0.85rem;
        padding: 0.75rem 0.75rem;
    }

    .mob-nav-btn {
        font-size: 0.62rem;
    }

    .mob-nav-btn i {
        font-size: 1.05rem;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .stat-mini {
        min-width: 110px;
    }

    .modal-box {
        max-height: 96vh;
    }
}

@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

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