/*
 * Doss UI layer (TASK-086): the Cairo font for the whole admin panel and login, plus a light polish
 * of cards, tables, forms, buttons and the sidebar. Loaded AFTER the theme stylesheet
 * (style.css / style_dark.css / rtl_style.css), so it only overrides.
 *
 * Only theme-neutral properties live at the top (font, radius, weight, spacing, shadow geometry).
 * Colours that would fight the dark theme are scoped to html:not([data-ui-theme="dark"]).
 * Icon fonts (feather, Font Awesome) set their own font-family on their own classes, so the font
 * rules below never touch them.
 */

:root {
    --doss-font: "Cairo", "Segoe UI", Tahoma, sans-serif;
    --bs-font-sans-serif: var(--doss-font);
    --bs-body-font-family: var(--doss-font);
    --doss-radius: 12px;
    --doss-radius-sm: 8px;
}

/* ── Font ───────────────────────────────────────────────────────────────────────────── */
body,
h1, h2, h3, h4, h5, h6,
.btn, .form-control, .form-select, .form-label, .input-group-text,
.table, .dropdown-menu, .nav-link, .modal, .tooltip, .popover, .badge, .alert,
.select2-container, .select2-results, .swal2-popup, .datepicker,
.sidebar, .navbar, .page-content, .card, .breadcrumb,
input, select, textarea, button,
.h1, .h2, .h3, .h4, .h5, .h6 {
    /* !important: rtl_style.css forces 'Open Sans' on body and headings with !important. */
    font-family: var(--doss-font) !important;
}

/* Cairo sits a little higher than Roboto: give Arabic text room to breathe. */
body { line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6, .card-title { font-weight: 700; letter-spacing: 0; }

/* ── Cards ──────────────────────────────────────────────────────────────────────────── */
.card {
    border-radius: var(--doss-radius);
    border-width: 0;
}
.card > .card-header:first-child { border-radius: var(--doss-radius) var(--doss-radius) 0 0; }
.card-header { padding: .8rem 1.1rem; }
.card-header .card-title, .card-header h6 { font-size: .95rem; margin-bottom: 0; }

/* ── Tables ─────────────────────────────────────────────────────────────────────────── */
.table thead th {
    text-transform: none;          /* uppercase means nothing in Arabic */
    font-weight: 600;
    font-size: .8rem;
    white-space: nowrap;
}
.table > :not(caption) > * > * { padding-top: .6rem; padding-bottom: .6rem; }

/* ── Forms & buttons ────────────────────────────────────────────────────────────────── */
.form-control, .form-select, .input-group-text,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border-radius: var(--doss-radius-sm);
}
.btn { border-radius: var(--doss-radius-sm); font-weight: 600; }
.btn-xs, .btn-sm { border-radius: 6px; }
.form-label { font-weight: 600; font-size: .82rem; }

/* ── Badges, alerts, modals ─────────────────────────────────────────────────────────── */
.badge { font-weight: 600; border-radius: 6px; padding: .35em .6em; }
.alert { border-radius: var(--doss-radius-sm); }
.modal-content { border-radius: var(--doss-radius); border: 0; }
.dropdown-menu { border-radius: var(--doss-radius-sm); }

/* ── Sidebar ────────────────────────────────────────────────────────────────────────── */
.sidebar .sidebar-body .nav .nav-item .nav-link .link-title { font-size: .9rem; font-weight: 600; }
.sidebar .sidebar-body .nav.sub-menu .nav-item .nav-link { font-size: .85rem; font-weight: 500; }

/* ── Light theme colours only ───────────────────────────────────────────────────────── */
html:not([data-ui-theme="dark"]) body { background-color: #f4f5fa; }
html:not([data-ui-theme="dark"]) .card {
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .06);
}
html:not([data-ui-theme="dark"]) .card-header { background-color: #fff; border-bottom: 1px solid #eef0f4; }
html:not([data-ui-theme="dark"]) .table thead th { color: #475467; background-color: #f8f9fc; }
html:not([data-ui-theme="dark"]) .table-hover > tbody > tr:hover > * { background-color: #f6f3fb; }
html:not([data-ui-theme="dark"]) .form-control:focus,
html:not([data-ui-theme="dark"]) .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--primary-color) 18%, transparent);
}
