@font-face {
    font-family: Tajawal;
    src: url("fonts/tajawal/Tajawal-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: Tajawal;
    src: url("fonts/tajawal/Tajawal-Bold.ttf") format("truetype");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: Tajawal;
    src: url("fonts/tajawal/Tajawal-ExtraBold.ttf") format("truetype");
    font-style: normal;
    font-weight: 800;
    font-display: swap;
}

:root {
    color-scheme: light;
    font-family: Tajawal, "Segoe UI", Tahoma, Arial, sans-serif;
    line-height: 1.65;
    color: #153651;
    background: #f2f7fb;
    --ink: #153651;
    --muted: #50667b;
    --accent: #10618d;
    --deep: #153e61;
    --line: #d9e5ee;
    --tint: #eaf5fc;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
.wrap { width: min(100% - 48px, 1340px); margin-inline: auto; }
.site-header { background: white; border-block: 4px solid #61c4e9; border-block-end: 1px solid var(--line); }
.masthead { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--deep); text-decoration: none; font-weight: 800; font-size: 1.65rem; }
.brand-mark { background: var(--deep); color: white; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; line-height: 1; font-size: 1.35rem; }
.cluster-logo { object-fit: contain; width: clamp(148px, 17vw, 215px); height: auto; }
.workspace { display: grid; grid-template-columns: minmax(155px, 196px) minmax(0,1fr); gap: clamp(16px, 3vw, 38px); align-items: start; padding-block: 28px 70px; }
.sidebar { background: var(--deep); border-radius: 16px; color: white; padding: 13px 9px; }
.sidebar nav { display: flex; flex-direction: column; gap: 5px; }
.sidebar a { color: #f1f8fd; text-decoration: none; padding: 11px 12px; border-radius: 8px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.sidebar a:hover { background: #285774; }
.sidebar a.current { color: #123b57; background: #bce8f8; }
.sidebar span[aria-hidden] { font-size: 1.2rem; line-height: 1; }
.sidebar a.logout { border-radius: 0; border-top: 1px solid #50718a; margin-block-start: 14px; font-size: .9rem; }
.content { min-width: 0; }
.public-content { padding-block: clamp(32px,9vh,96px); }
h1,h2 { line-height: 1.45; color: var(--deep); }
h1 { margin: 0 0 20px; font-size: clamp(1.65rem,3vw,2.15rem); overflow-wrap: anywhere; }
h2 { margin: 0 0 15px; font-size: 1.22rem; }
.page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 20px; }
.page-heading h1 { margin: 0; }
.heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card,.metric { border: 1px solid var(--line); border-radius: 14px; background: white; }
.card { padding: clamp(17px,2.5vw,30px); }
.auth,.editor { max-width: 660px; margin-inline: auto; }
.auth { max-width: 450px; border-top: 4px solid #63c8e9; box-shadow: 0 12px 36px #133a6010; }
.auth button { width: 100%; }
.columns,.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; align-items: start; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-block-end: 20px; }
.metric { color: var(--muted); text-decoration: none; padding: 12px 18px; }
.metric strong { display: block; color: var(--deep); font-size: 1.7rem; font-variant-numeric: tabular-nums; line-height: 1.45; }
.metric.selected,.metric:hover { border-color: #79b8d6; background: var(--tint); }
button,.button { display: inline-block; min-height: 42px; border-radius: 8px; background: var(--accent); color: white; padding: 7px 16px; border: 1px solid var(--accent); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; }
button:hover,.button:hover { background: #134c70; color: white; }
.secondary,.button.secondary { color: var(--accent); background: white; border-color: #a0bece; }
.secondary:hover { color: var(--deep); background: var(--tint); }
form button { margin-block-start: 16px; }
label { display: block; margin-block: 12px 4px; font-weight: 600; }
input:not([type=hidden]),select,textarea { width: 100%; background: white; border: 1px solid #9fb6c6; border-radius: 7px; padding: 8px 10px; min-height: 43px; color: var(--ink); font: inherit; }
textarea { resize: vertical; }
:where(a,button,input,textarea,select):focus-visible { outline: 3px solid #197fac; outline-offset: 3px; }
.results { padding: 0; overflow: hidden; }
.task-table { width: 100%; border-collapse: collapse; }
.task-table :is(th,td) { vertical-align: top; text-align: start; padding: 13px 14px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.task-table th { background: #eaf3f9; color: #36566e; font-size: .92rem; }
.task-table tr:last-child td { border-bottom: 0; }
.task-title { font-weight: 700; text-decoration: none; }
.task-title:hover { text-decoration: underline; }
small,.hint { color: var(--muted); }
small { display: block; }
.tag { display: inline-block; color: #20516f; background: #e9f2f8; border-radius: 99px; padding: 1px 9px; font-size: .86rem; margin-inline-end: 3px; }
.overdue,.error,.validation-errors { color: #922f2d; background: #fff0ee; }
.request { color: #744c06; background: #fff2d7; }
.read { color: #216247; background: #e2f4ea; }
.notice,.error,.validation-errors,.empty { padding: 12px 15px; border-radius: 8px; }
.empty { text-align: center; padding-block: 28px; }
.empty p { margin: 0 0 4px; }
.notice { background: #eaf5fc; margin-block-start: 16px; }
.validation-errors { padding-inline-start: 30px; }
.hint { margin: 0 0 4px; font-size: .9rem; }
.back { display: inline-flex; margin-block-end: 14px; font-size: .94rem; }
/* The same task fields are used in mobile cards and on the details page. */
.task-cards,.add-personal-icon { display: none; }
.task-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}
.task-field {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f5f9fc;
    line-height: 1.4;
}
.task-field dt { color: var(--muted); font-size: .82rem; }
.task-field dd { margin: 3px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.task-field-placeholder { color: var(--muted); font-weight: 400; }
.task-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.task-field .tag { margin: 0; padding: 2px 7px; }
.tag[data-status="InProgress"],.tag[data-priority="Low"] { color: #145781; background: #e0effa; }
.tag[data-status="Waiting"] { color: #744c06; background: #fff2d7; }
.tag[data-status="Completed"] { color: #216247; background: #e2f4ea; }
.tag[data-status="Cancelled"],.tag[data-priority="Normal"] { color: #40566a; background: #e8eef3; }
.tag[data-priority="High"] { color: #922f2d; background: #fbe5e6; }
.multiline { white-space: pre-wrap; overflow-wrap: anywhere; }
.history { margin-block-start: 18px; }
.people,.history ol,.agenda { list-style: none; margin: 0; padding: 0; }
.history li,.notice-row { padding-block: 10px; border-block-start: 1px solid var(--line); }
.people { display: grid; gap: 10px; }
.people li {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f5f9fc;
    overflow-wrap: anywhere;
}
.people bdi,.notice-row bdi { overflow-wrap: anywhere; }
.people bdi { display: block; }
.columns.team-accounts { grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr); }
.member-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(85px, 1fr) auto; align-items: end; gap: 10px; margin-block-end: 18px; }
.member-filters :is(label,button) { margin-block-start: 0; }
.member-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); }
.member-cards li { display: grid; align-content: start; gap: 8px; }
.member-title { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.member-title .tag { flex: none; }
.member-cards .button { justify-self: start; }
.member-panels { display: grid; gap: 16px; max-width: 700px; margin-inline: auto; }
.member-panels h1 { margin-block-end: 0; }
.member-panels .notice { overflow-wrap: anywhere; }
.danger { background: #903c36; border-color: #903c36; }
@media (max-width: 880px) { .columns.team-accounts { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
    .member-filters { grid-template-columns: minmax(0,1fr) auto; }
    .member-filters > :first-child { grid-column: 1 / -1; }
    .member-cards .button { justify-self: stretch; }
}
.history p { margin-block: 4px 0; }
.tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-block: 0 14px; }
.tabs a { text-decoration: none; padding: 5px 13px; border-radius: 8px; }
.tabs .active { color: white; background: var(--deep); }
[data-kind="Task"] { --kind-color: #145781; --kind-bg: #ebf5fb; --kind-line: #bed7e8; }
[data-kind="Reminder"] { --kind-color: #62408a; --kind-bg: #f3eef9; --kind-line: #d9cde9; }
[data-kind="Appointment"] { --kind-color: #216247; --kind-bg: #edf7f1; --kind-line: #c7e0d2; }
.agenda li { display: flex; align-items: center; gap: 13px; padding: 14px 18px; }
.separate { border-block-start: 1px solid var(--line); }
.agenda li>div { min-width: 0; overflow-wrap: anywhere; }
.date-tile { display: grid; min-width: 65px; justify-items: center; border-radius: 10px; background: var(--tint); font-size: .75rem; padding: 3px 5px; direction: ltr; }
.tabs a[data-kind] { color: var(--kind-color, var(--accent)); }
.tabs a[data-kind="Task"],.tabs a[data-kind="Reminder"],.tabs a[data-kind="Appointment"] {
    color: var(--kind-color);
    background: var(--kind-bg);
    border-color: var(--kind-line);
}
.tabs a.active[data-kind] { color: white; background: var(--kind-color, var(--deep)); border-color: var(--kind-color, var(--deep)); }
.personal-results:has(.agenda) { background: transparent; border: 0; overflow: visible; }
.agenda { display: grid; gap: 10px; }
.agenda li {
    background: var(--kind-bg, white);
    border: 1px solid var(--kind-line, var(--line));
    border-inline-start: 4px solid var(--kind-color, var(--line));
    border-radius: 14px;
}
.agenda .task-title { color: var(--kind-color, var(--accent)); }
.agenda .date-tile { color: var(--kind-color, var(--accent)); background: white; }
.date-tile b { font-size: 1.3rem; }
.separate { margin-block-start: 18px; }
.metric[data-filter="all"] { display: grid; place-items: center; text-align: center; font-weight: 700; }
.pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin-block-start: 16px;
}
.pagination .button { padding-inline: 8px; }
.previous-page { grid-column: 1; }
.page-number { grid-column: 2; color: var(--muted); text-align: center; }
.next-page { grid-column: 3; }
.logout-card { text-align: center; }
.logout-card h1 { margin-block-end: 5px; }
.logout-card p { color: var(--muted); margin-block: 0 18px; }
.logout-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.logout-actions button { margin: 0; }
.logout-actions .button,.logout-actions button { padding-inline: 6px; }
@media(max-width:880px) {
    .workspace { display: block; padding-block-start: 14px; }
    .sidebar { padding: 5px; margin-block-end: 20px; }
    .sidebar nav { flex-flow: row wrap; align-items: center; }
    .sidebar a { padding: 7px 12px; }
    .sidebar a.logout { margin-block-start: 0; margin-inline-start: auto; border: 0; }
}
@media(max-width:680px) {
    .wrap { width: min(100% - 24px, 1340px); }
    .masthead { min-height: 66px; }
    .sidebar a { font-size: .88rem; padding: 8px; gap: 4px; }
    .sidebar span[aria-hidden] { display: none; }
    .columns,.fields { grid-template-columns: 1fr; }
    .card { padding: 16px; }
    .results { padding: 0; }

    .personal-heading { flex-wrap: nowrap; gap: 8px; }
    .add-personal {
        display: inline-grid;
        place-items: center;
        flex: 0 0 44px;
        block-size: 44px;
        padding: 0;
    }
    .add-personal-icon { display: block; font-size: 1.65rem; line-height: 1; }
    .add-personal-label { display: none; }
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 4px;
        padding: 4px;
        margin-inline: -4px;
    }
    .tabs a {
        flex: 1 0 auto;
        align-content: center;
        min-block-size: 40px;
        padding: 4px clamp(4px, 1.25vw, 9px);
        border: 1px solid var(--line);
        background: white;
        white-space: nowrap;
        text-align: center;
        font-size: clamp(.76rem, 3.3vw, .95rem);
    }
    .tabs .active { background: var(--deep); border-color: var(--deep); }
    .task-results:has(.task-cards) {
        border: 0;
        background: transparent;
        overflow: visible;
    }
    .task-cards { display: grid; gap: 10px; }
    .agenda li { padding: 12px; }
    .team-accounts .invite-card button[type="submit"] { width: 100%; }

    .team-heading { display: grid; grid-template-columns: minmax(0, 1fr); }
    .team-heading h1 {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .team-heading .heading-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .team-heading .button {
        display: grid;
        place-items: center;
        height: 100%;
        padding: 7px 4px;
        font-size: clamp(.8rem, 3.65vw, 1rem);
        line-height: 1.3;
    }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .metric {
        display: flex;
        align-items: center;
        gap: 9px;
        padding: 7px 10px;
        font-weight: 700;
        color: #40566a;
        background: #edf2f5;
    }
    .metric[data-filter="open"] { color: #145781; background: #e2f0fa; }
    .metric[data-filter="overdue"] { color: #922f2d; background: #fbe8e9; }
    .metric[data-filter="done"] { color: #216247; background: #e4f4eb; }
    .metric strong { color: inherit; font-size: 1.25rem; }
    .metric.selected,.metric:hover { border-color: currentColor; }
    .task-table { display: none; }
    .task-cards { margin: 0; padding: 0; list-style: none; }
    .task-card { padding: 12px; }
    .task-card h2 { margin-block-end: 10px; overflow-wrap: anywhere; }
    .task-field dd { font-size: .9rem; }
}
