/* Dubai Font - released free for public use by the Government of Dubai,
   designed to give Latin and Arabic text a matching look. Self-hosted
   (rather than a CDN) so the app doesn't depend on a third party staying
   up. woff2/woff cover every browser in real use; legacy ttf/eot formats
   are intentionally left out. */
@font-face {
    font-family: 'Dubai';
    src: url('/assets/fonts/dubai/Dubai-Light.woff2') format('woff2'),
         url('/assets/fonts/dubai/Dubai-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Dubai';
    src: url('/assets/fonts/dubai/Dubai-Regular.woff2') format('woff2'),
         url('/assets/fonts/dubai/Dubai-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Dubai';
    src: url('/assets/fonts/dubai/Dubai-Medium.woff2') format('woff2'),
         url('/assets/fonts/dubai/Dubai-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Dubai';
    src: url('/assets/fonts/dubai/Dubai-Bold.woff2') format('woff2'),
         url('/assets/fonts/dubai/Dubai-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-bg: #f6f7f9;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-text: #1f2430;
    --color-text-muted: #6b7280;
    --color-accent: #2f6f5e;
    --color-accent-hover: #255a4c;
    --color-danger: #b3413a;
    --color-danger-bg: #fbebea;
    --color-success: #2f6f5e;
    --color-success-bg: #eaf3f0;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
    font-size: 17px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    /* Dubai Font handles both Latin and Arabic; the system fonts after it
       are only a fallback for the moment before it finishes loading. */
    font-family: 'Dubai', -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Roboto, Helvetica, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

:root[dir="rtl"] body {
    font-family: 'Dubai', Tahoma, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

a { color: var(--color-accent); }

/* ---------- Auth screen ---------- */

.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 40px 32px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.lang-toggle {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.lang-toggle button {
    padding: 4px 12px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-text-muted);
}

.lang-toggle button.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.sidebar-footer .lang-toggle {
    margin-bottom: 10px;
}

.auth-brand .brand-logo {
    display: block;
    max-width: 300px;
    max-height: 150px;
    width: auto;
    height: auto;
    margin: 0 auto 14px;
    object-fit: contain;
}

.auth-brand .logo-dot {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 32px;
    margin: 0 auto 14px;
}

.auth-brand h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}

.auth-brand p {
    color: var(--color-text-muted);
    font-size: 15px;
    margin: 4px 0 0;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--color-text);
}

.field input, .field select, .field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 16px;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s ease;
    font-family: inherit;
}

.field textarea {
    resize: vertical;
    min-height: 60px;
}

.logo-preview {
    width: 120px;
    height: 80px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--color-surface);
    flex-shrink: 0;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pro-category-commission-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border);
}

.pro-category-commission-row:last-child { border-bottom: none; }
.pro-category-commission-row .cat-name { font-size: 15.5px; }
.pro-category-commission-row input { width: 100px; }

.privilege-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border);
}

.privilege-row:last-child { border-bottom: none; }
.privilege-row input { width: auto; }
.privilege-row label { margin: 0; font-size: 15.5px; font-weight: 400; }

.privileges-list {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 2px 12px;
}

.two-col-form {
    display: flex;
    gap: 24px;
}

.two-col-form .form-col {
    flex: 1;
    min-width: 0;
}

@media (max-width: 640px) {
    .two-col-form {
        flex-direction: column;
        gap: 0;
    }
}

.logo-preview .placeholder {
    font-size: 13px;
    color: var(--color-text-muted);
    text-align: center;
    padding: 0 8px;
}

.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
    width: 100%;
}

.btn-primary:hover { background: var(--color-accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

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

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

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

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    flex-shrink: 0;
}

.alert {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 16px;
}

.alert-error {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.hidden { display: none !important; }

/* ---------- App shell ---------- */

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

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--color-surface);
    border-inline-end: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 8px 8px 20px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-brand .brand-logo {
    display: block;
    max-width: 100%;
    max-height: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sidebar-brand .logo-dot {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--color-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 24px;
}

.sidebar-brand span {
    font-weight: 600;
    font-size: 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 2px;
}

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

.nav-item.active {
    background: var(--color-success-bg);
    color: var(--color-accent);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.sidebar-user {
    font-size: 15px;
    padding: 0 8px 10px;
}

.sidebar-user .name { font-weight: 600; }
.sidebar-user .role { color: var(--color-text-muted); font-size: 14px; text-transform: capitalize; }

.main {
    flex: 1;
    padding: 28px 36px;
}

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

.page-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.page-header p {
    color: var(--color-text-muted);
    font-size: 15px;
    margin: 4px 0 0;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

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

.card-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.card-body { padding: 20px; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15.5px;
}

th, td {
    text-align: start;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
}

th {
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

tr:last-child td { border-bottom: none; }

tbody tr.row-clickable { cursor: pointer; }
tbody tr.row-clickable:hover { background: var(--color-bg); }

td .btn {
    margin-block: 2px;
}

td .btn:not(:last-child) {
    margin-inline-end: 6px;
}

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
}

.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-neutral { background: var(--color-bg); color: var(--color-text-muted); }

.chart-panel {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.chart-row:last-child { margin-bottom: 0; }

.chart-label {
    width: 140px;
    flex-shrink: 0;
    font-size: 15px;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-bar-track {
    flex: 1;
    height: 14px;
    background: var(--color-bg);
    border-radius: 999px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 999px;
}

.chart-value {
    width: 100px;
    flex-shrink: 0;
    text-align: end;
    font-size: 15px;
    font-weight: 600;
}

.chart-empty {
    color: var(--color-text-muted);
    font-size: 15px;
}

.chart-legend-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-inline-end: 6px;
    flex-shrink: 0;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 8px;
}

.calendar-weekdays div {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 4px 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-day {
    min-height: 92px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 6px;
    background: var(--color-bg);
}

.calendar-day.is-empty {
    border-color: transparent;
    background: transparent;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.calendar-leave-chip {
    display: block;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-leave-chip.approved { background: var(--color-success-bg); color: var(--color-success); }
.calendar-leave-chip.pending { background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text-muted); }

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

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

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.filter-grid .field { margin-bottom: 0; }

/* The official UAE Dirham symbol isn't renderable as a font character yet
   (Unicode 18.0 support is still rolling out), so it's a small bundled SVG
   sized and aligned to sit inline with the amount that follows it. */
.currency-icon {
    height: 0.78em;
    width: auto;
    vertical-align: -0.05em;
    margin-inline-end: 3px;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    cursor: default;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.stat-card .label {
    font-size: 14.5px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 26px;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--color-text-muted);
}

.empty-state .icon {
    font-size: 34px;
    margin-bottom: 12px;
}

/* ---------- Modal ---------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 32, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.upload-progress-track { background: var(--color-border); border-radius: 999px; height: 8px; overflow: hidden; }
.upload-progress-fill { background: var(--color-accent); height: 100%; width: 0%; transition: width 0.15s linear; }
.upload-progress-label { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }

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

.modal-header h3 { margin: 0; font-size: 18px; font-weight: 600; }

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

.modal-body { padding: 20px; overflow-y: auto; }

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

.text-right { text-align: end; }
.flex-row { display: flex; gap: 10px; align-items: center; }

/* Filter/Clear sit in a plain block-level row (unlike the hug-sized
   .flex-row used inside .page-header), so .btn-primary's width:100%
   would otherwise stretch the Filter button across the whole card. */
.filter-actions .btn { width: auto; }
.mt-16 { margin-top: 16px; }

/* ---------- Invoicing ---------- */

.subnav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 20px;
}

.subnav-item {
    padding: 10px 4px;
    margin-inline-end: 20px;
    font-size: 15.5px;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.subnav-item:hover { color: var(--color-text); }

.subnav-item.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.subview.hidden { display: none; }

.autocomplete-wrap, .service-picker {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    max-height: 240px;
    overflow-y: auto;
    z-index: 30;
    text-align: start;
}

.autocomplete-item {
    padding: 8px 12px;
    font-size: 15.5px;
    cursor: pointer;
}

.autocomplete-item:hover { background: var(--color-bg); }
.autocomplete-item .meta { color: var(--color-text-muted); font-size: 14px; float: right; }
[dir="rtl"] .autocomplete-item .meta { float: left; }

.autocomplete-category {
    padding: 6px 12px 4px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    background: var(--color-bg);
}

.autocomplete-indent { padding-inline-start: 24px; }

.autocomplete-action {
    color: var(--color-accent);
    font-weight: 500;
    border-bottom: 1px solid var(--color-border);
}

.selected-chip {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--color-success-bg);
    color: var(--color-text);
    border-radius: 8px;
    font-size: 15.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-chip button {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 15px;
}

.totals-box {
    max-width: 320px;
    margin-inline-start: auto;
    margin-top: 20px;
    margin-bottom: 20px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 15.5px;
    color: var(--color-text-muted);
}

.totals-row.totals-grand {
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
    padding-top: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

/* Informational only - not part of the subtotal/VAT/total math above it. */
.totals-row.totals-commission-row {
    border-top: 1px dashed var(--color-border);
    margin-top: 4px;
    padding-top: 10px;
    font-size: 14.5px;
    font-style: italic;
}

.qty-input { width: 100%; padding: 6px 8px; border: 1px solid var(--color-border); border-radius: 6px; }
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input[type="number"] { -moz-appearance: textfield; }

.status-select {
    padding: 5px 8px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14.5px;
    background: var(--color-surface);
    color: var(--color-text);
}

.item-service-search, .item-custom-desc {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 15.5px;
}

.invoice-view-row {
    display: flex;
    justify-content: space-between;
    font-size: 15.5px;
    padding: 4px 0;
}

.invoice-view-row.total {
    font-weight: 600;
    font-size: 17px;
    border-top: 1px solid var(--color-border);
    margin-top: 8px;
    padding-top: 10px;
}

.invoice-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--color-text);
    margin-bottom: 14px;
}

.invoice-doc-identity {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.invoice-doc-logo {
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
    flex-shrink: 0;
}

.invoice-doc-company {
    font-size: 20px;
    font-weight: 700;
}

.invoice-doc-subline {
    font-size: 13.5px;
    color: var(--color-text-muted);
    margin-top: 3px;
}

.invoice-doc-title-block {
    text-align: end;
    flex-shrink: 0;
}

.invoice-doc-title {
    font-size: 14.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.invoice-doc-number {
    font-size: 16px;
    font-weight: 600;
    margin-top: 3px;
}

.invoice-doc-date {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.invoice-doc-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.invoice-doc-queue .label {
    font-size: 13px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.invoice-doc-queue .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 0.05em;
}

.invoice-doc-parties {
    margin-bottom: 18px;
}

.invoice-doc-parties .label {
    font-size: 13px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 3px;
}

.invoice-doc-parties .name {
    font-weight: 600;
    font-size: 16px;
}

.invoice-doc-parties .meta {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-top: 1px;
}

.invoice-doc-table {
    margin-bottom: 14px;
}

.invoice-doc-totals {
    border-top: 1px solid var(--color-border);
    padding-top: 8px;
}

.invoice-doc-notes {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
    font-size: 14.5px;
    color: var(--color-text-muted);
}

.invoice-doc-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Width/centering for the printable invoice document rendered into
   #invoice-print-root. */
.invoice-doc-page { max-width: 720px; margin: 0 auto; }

/* Printing an invoice renders it into #invoice-print-root (normally
   display:none) and calls window.print() on the current page - see
   invoicing.js's print actions - rather than printing the dashboard's own
   chrome or opening a separate tab. This hides everything else on the page
   so only that rendered document prints. */
#invoice-print-root { display: none; }

@media print {
    @page { margin: 12mm; }
    body { background: #fff !important; }
    body > *:not(#invoice-print-root) { display: none !important; }
    #invoice-print-root { display: block !important; }
}

/* ---- Monitor page utilities ---- */
.muted { color: var(--color-text-muted); font-size: 14px; }
.table-wrap { overflow-x: auto; }
.modal.modal-lg { max-width: 720px; }
.mon-flag-dot { display:inline-block; width:10px; height:10px; border-radius:50%; }
.mon-flag-dot.external { background: var(--color-danger); }
.mon-flag-dot.ok { background: var(--color-success); }
