/* The app's palette (lib/core/palette.dart) and parent-area sizes (lib/core/type.dart): cream, ink, purple; 20px cards,
   14px buttons 44px high. Fonts are served from this app (no font CDN). */
@font-face { font-family: 'Roboto'; src: url(../fonts/Roboto-Regular.ttf); font-weight: 400; }
@font-face { font-family: 'Roboto'; src: url(../fonts/Roboto-Medium.ttf); font-weight: 500; }
@font-face { font-family: 'Roboto'; src: url(../fonts/Roboto-Bold.ttf); font-weight: 700; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url(../fonts/IBMPlexSansArabic-Regular.ttf); font-weight: 400; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url(../fonts/IBMPlexSansArabic-Medium.ttf); font-weight: 500; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url(../fonts/IBMPlexSansArabic-Bold.ttf); font-weight: 700; }

:root {
    --cream: #FDF8E6; --white: #FFFFFF; --ink: #5A3A28; --caption: #7B6556; --border: #E8D5A9;
    --purple: #70508E; --selected: #F2EAFB; --green: #4C9A3C; --danger: #D93636; --track: #F1E6CC;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Roboto', system-ui, sans-serif; font-size: 16px; line-height: 1.45; color: var(--ink); background: var(--cream); }
[dir=rtl] body { font-family: 'IBM Plex Sans Arabic', 'Roboto', system-ui, sans-serif; }
.top { display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: var(--white); border-bottom: 1.5px solid var(--border); }
.top img { width: 48px; height: 48px; }
.top h1 { margin: 0; font-size: 24px; font-weight: 700; flex: 1; }
.top .who { color: var(--caption); font-size: 14px; }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; padding: 6px 4px; color: var(--purple); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.wrap { display: flex; max-width: 1320px; margin: 0 auto; }
nav { width: 210px; padding: 22px 0 0; flex-shrink: 0; }
nav a { display: block; padding: 10px 22px; color: var(--ink); text-decoration: none; font-weight: 500; border-radius: 14px; margin: 2px 10px; }
nav a.on { background: var(--selected); color: var(--purple); font-weight: 700; }
/* the phone menu: hidden on wide screens, where the menu is a column at the start side */
.menu-btn, .menu-close, .nav-shade { display: none; }
nav a:focus-visible, .btn:focus-visible, button.link:focus-visible, input:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
main { flex: 1; min-width: 0; padding: 22px 28px 40px 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-content: start; }
[dir=rtl] main { padding: 22px 8px 40px 28px; }
.single { max-width: 460px; margin: 48px auto; padding: 0 16px; }
.card { background: var(--white); border: 1.5px solid var(--border); border-radius: 20px; padding: 16px 18px; min-width: 0; overflow-x: auto; }
.wide { grid-column: 1 / -1; }
h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
h3 { margin: 18px 0 4px; font-size: 16px; font-weight: 700; color: var(--purple); }
.hint { color: var(--caption); font-size: 13px; margin: 0 0 14px; }
.hint.flush { margin: 0; }
.notice { margin: 0; padding: 10px 14px; border-radius: 14px; font-weight: 500; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.stat { flex: 1; min-width: 120px; background: var(--cream); border-radius: 16px; padding: 10px 14px; }
.stat b { display: block; font-size: 28px; font-weight: 700; }
.stat span { color: var(--caption); font-size: 13px; }
progress { display: block; width: 100%; height: 10px; margin: 2px 0 14px; border: 0; border-radius: 6px; background: var(--track); overflow: hidden; -webkit-appearance: none; appearance: none; }
progress::-webkit-progress-bar { background: var(--track); border-radius: 6px; }
progress::-webkit-progress-value { background: var(--purple); border-radius: 6px; }
progress::-moz-progress-bar { background: var(--purple); border-radius: 6px; }
label { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 10px 0; font-size: 16px; }
label.col { display: block; }
label.plain { display: inline; margin: 0; }
input[type=number], input[type=text], input[type=email], input[type=password] { width: 160px; height: 44px; padding: 0 12px; border: 1.5px solid #DDD0EC; border-radius: 14px; font: inherit; color: var(--ink); background: var(--white); }
input.long { width: 100%; margin-top: 6px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--purple); }
input.switch { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 13px; background: #CBBFD8; position: relative; cursor: pointer; margin: 0; flex-shrink: 0; }
input.switch::after { content: ""; position: absolute; inset-inline-start: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; }
input.switch:checked { background: var(--purple); }
input.switch:checked::after { inset-inline-start: 21px; }
.btn { height: 44px; padding: 0 18px; border-radius: 14px; border: 0; background: var(--purple); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 14px; margin: 8px 0; }
.checks label { margin: 0; flex-wrap: nowrap; gap: 8px; font-size: 15px; white-space: nowrap; }
.checks input { flex-shrink: 0; }
td.pages { width: 60%; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: start; padding: 9px 8px; border-bottom: 1px solid #F3E9D2; vertical-align: top; }
th { color: var(--caption); font-weight: 500; font-size: 13px; }
td.value { word-break: break-word; max-width: 520px; font-size: 13px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 13px; font-weight: 700; }
.ok { background: #E6F3EA; color: var(--green); }
.off { background: #FDE7E7; color: var(--danger); }
.wait { background: #FFF3D6; color: #8A6D1D; }
code { background: var(--cream); padding: 1px 6px; border-radius: 6px; font-size: 13px; direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 860px) {
    .wrap { flex-direction: column; }
    /* the menu is a side panel from the start side (left in English, right in Arabic), opened by the button in the header;
       choosing a page, the close button or the shade around it closes it */
    .menu-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--selected); color: var(--purple); }
    nav { display: none; position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(280px, 82vw); z-index: 30; overflow-y: auto;
          background: var(--white); padding: 56px 0 24px; box-shadow: 0 0 40px rgba(90, 58, 40, .25); }
    nav:target { display: block; }
    nav a { padding: 12px 22px; }
    .menu-close { display: grid; place-items: center; position: absolute; top: 8px; inset-inline-end: 8px; width: 44px; height: 44px; margin: 0;
                  padding: 0; font-size: 28px; line-height: 1; color: var(--caption); }
    nav:target + .nav-shade { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(90, 58, 40, .35); }
    .top .who { display: none; }
    main, [dir=rtl] main { grid-template-columns: 1fr; padding: 14px 16px 32px; }
    .top { padding: 10px 16px; flex-wrap: wrap; }
    .top h1 { font-size: 20px; }
}
