/* The platform's pages: Tajawal, right to left, a light and a dark theme */
@font-face { font-family: Tajawal; src: url(/static/fonts/Tajawal-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Tajawal; src: url(/static/fonts/Tajawal-Medium.ttf) format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: Tajawal; src: url(/static/fonts/Tajawal-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }

:root {
    --bg: #f3f6f5;
    --surface: #ffffff;
    --surface-2: #f7faf9;
    --line: #dde5e2;
    --fg: #17201e;
    --muted: #5d6a67;
    --acc: #0f6e66;
    --acc-ink: #ffffff;
    --acc-soft: #e2f1ee;
    --warn: #9a5b00;
    --warn-soft: #fff4dc;
    --bad: #b42318;
    --bad-soft: #fde8e6;
    --good: #1a7f4b;
    --shadow: 0 1px 2px rgba(16, 24, 22, .06), 0 8px 24px rgba(16, 24, 22, .06);
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1514; --surface: #161e1c; --surface-2: #1b2522; --line: #2a3633; --fg: #e8efed; --muted: #9fb0ac;
        --acc: #3fb8a8; --acc-ink: #06211e; --acc-soft: #12302c; --warn: #f0b75a; --warn-soft: #33270f;
        --bad: #ff8a80; --bad-soft: #3a1714; --good: #6fd39c; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0f1514; --surface: #161e1c; --surface-2: #1b2522; --line: #2a3633; --fg: #e8efed; --muted: #9fb0ac;
    --acc: #3fb8a8; --acc-ink: #06211e; --acc-soft: #12302c; --warn: #f0b75a; --warn-soft: #33270f;
    --bad: #ff8a80; --bad-soft: #3a1714; --good: #6fd39c; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Tajawal, "Segoe UI", Tahoma, sans-serif; font-size: 15px; line-height: 1.6; background: var(--bg); color: var(--fg); }
a { color: var(--acc); }
h1, h2, h3 { line-height: 1.3; margin: 0; text-wrap: balance; }
button, input, select { font: inherit; color: inherit; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
[hidden] { display: none !important; }

/* buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; text-decoration: none; color: var(--fg); }
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, .field input:focus-visible { outline: 3px solid color-mix(in srgb, var(--acc) 40%, transparent); outline-offset: 1px; }
.btn-primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--acc) 88%, #000); }
.btn-danger { color: var(--bad); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn[disabled] { opacity: .6; cursor: default; }
.icon-btn { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.icon-btn svg { width: 18px; height: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 500; font-size: 14px; }
.field input { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.field small { color: var(--muted); }
.form-error { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: 14px; }

/* the sign-in and register pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: var(--acc); color: var(--acc-ink); padding: 48px max(32px, 6vw); display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.auth-side h1 { font-size: 34px; }
.auth-side p { margin: 0; max-width: 46ch; opacity: .92; }
.auth-side ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.auth-side li { display: flex; gap: 10px; align-items: flex-start; }
.auth-side li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 9px; border-radius: 50%; background: currentColor; opacity: .7; }
.auth-main { display: grid; place-items: center; padding: 32px max(16px, env(safe-area-inset-left, 0px)); }
.auth-card { width: min(420px, 100%); display: grid; gap: 18px; }
.auth-card h2 { font-size: 26px; }
.auth-card .sub { color: var(--muted); margin: -10px 0 0; }
.auth-card form { display: grid; gap: 14px; }
.auth-card .btn-primary { height: 46px; }
.auth-foot { color: var(--muted); font-size: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--acc); display: grid; place-items: center; color: var(--acc-ink); flex: none; }
.auth-side .brand-mark { background: var(--acc-ink); color: var(--acc); }
.brand-mark svg { width: 20px; height: 20px; }
@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth-side { padding: 28px 16px; }
    .auth-side h1 { font-size: 26px; }
    .auth-side ul { display: none; }
}

/* the dashboard */
.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 12px; height: 62px;
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top .spacer { flex: 1; }
.who { color: var(--muted); font-size: 14px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-block: 28px 64px; display: grid; gap: 22px;
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.hello h1 { font-size: 26px; }
.hello p { margin: 4px 0 0; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 20px; display: grid; gap: 14px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 18px; flex: 1; }
.muted { color: var(--muted); }
.banner { border-radius: 12px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.trial { background: var(--acc-soft); }
.banner.ended { background: var(--warn-soft); color: var(--warn); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.list th { text-align: start; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td .btn { white-space: nowrap; }
table.list td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.chip.wait { background: var(--warn-soft); color: var(--warn); }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
.steps li::before { content: counter(s); width: 30px; height: 30px; border-radius: 50%; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 14px; }
code, .code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
.keybox { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px dashed var(--acc); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.keybox code { flex: 1; min-width: 0; overflow-wrap: anywhere; direction: ltr; text-align: left; }

/* dialogs and toasts */
.modal-back { position: fixed; inset: 0; background: rgba(8, 14, 13, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; width: min(520px, 100%); padding: 22px; display: grid; gap: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal h3 { font-size: 19px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 18px; inset-inline-start: 18px; display: grid; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; }
.toast.danger { background: var(--bad); color: #fff; }
.toast.success { background: var(--good); color: #fff; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--acc); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.center { min-height: 100%; display: grid; place-items: center; gap: 12px; text-align: center; padding: 24px; }

/* the designer page: the designer fills it; the page stays light (it shows paper) */
body.design { overflow: hidden; }
.design-shell { height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.design-bar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 13.5px; min-width: 0; }
.design-bar .spacer { flex: 1; }
.design-bar .db { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.design-host { position: relative; min-height: 0; }
.design-host > .o_qd { height: 100%; }
.blocker { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(255, 255, 255, .35); }

/* what the designer takes from Odoo's own styles */
.o_qd { color: #374151; color-scheme: light; }
.o_qd .form-control, .o_qd .form-select { display: block; width: 100%; height: 30px; padding: 2px 8px; border: 1px solid #d9dfdd; border-radius: 6px; background: #fff; font-size: 13px; }
.o_qd .form-control-sm, .o_qd .form-select-sm { height: 28px; font-size: 12.5px; }
.o_qd .text-danger { color: #b42318; }
.o_qd button { font-family: inherit; }
.o_qd input, .o_qd select, .o_qd textarea { font-family: inherit; }
