/* «صقر» — واجهة لطيفة: حدودٌ سميكة، زوايا مدوّرة، ظلٌّ مزاح، ألوان رمليّة مع ألوانٍ مرحة */
:root {
    --ink: #2b2a33;
    --ink-2: #5d5a6b;
    --sand: #f4e9d8;
    --cream: #fffaf1;
    --paper: #ffffff;
    --sky: #dbeeff;
    --line: #2b2a33;
    --brown: #8b5e34;
    --yellow: #ffc93c;
    --yellow-soft: #fff1c7;
    --green: #2fbf71;
    --green-soft: #d9f6e6;
    --blue: #4c8dff;
    --blue-soft: #dfeaff;
    --pink: #ff5c8a;
    --pink-soft: #ffe0ea;
    --orange: #ff8a3d;
    --orange-soft: #ffe6d4;
    --radius: 22px;
    --shadow: 0 4px 0 var(--line);
    --shadow-sm: 0 3px 0 var(--line);
    color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Baloo Bhaijaan 2', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--sand) radial-gradient(circle at 20% 0%, #fff6e6 0, transparent 45%) fixed;
}
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 800; }
.muted { color: var(--ink-2); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ——— الهيكل ——— */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; min-height: 100vh; padding: 18px; }
.side {
    position: sticky; top: 18px; align-self: start;
    display: flex; flex-direction: column; gap: 14px;
    padding: 18px 14px; background: var(--cream);
    border: 3px solid var(--line); border-radius: 28px; box-shadow: var(--shadow);
    min-height: calc(100vh - 40px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; text-decoration: none; }
.brand-mark {
    display: grid; place-items: center; width: 52px; height: 52px; flex: none; overflow: hidden;
    background: var(--yellow); border: 3px solid var(--line); border-radius: 50%; box-shadow: var(--shadow-sm);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; object-position: top; transform: translateY(4px) scale(1.15); }
.brand b { display: block; font-size: 1.5rem; line-height: 1; }
.brand small { color: var(--ink-2); font-size: .8rem; }
.nav { display: grid; gap: 6px; margin-top: 6px; }
.nav a {
    white-space: nowrap; font-size: .95rem;
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border: 2px solid transparent; border-radius: 16px; text-decoration: none; font-weight: 700;
}
.nav a:hover { background: var(--paper); border-color: var(--line); }
.nav a.on { background: var(--yellow); border-color: var(--line); box-shadow: var(--shadow-sm); }
.nav .ico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: var(--paper); border: 2px solid var(--line); }
.nav .ico svg { width: 18px; height: 18px; }
.nav .soon { margin-inline-start: auto; font-size: .7rem; font-weight: 700; padding: 0 8px; border-radius: 99px; background: var(--sky); border: 1.5px solid var(--line); }
.nav a.disabled { opacity: .55; pointer-events: none; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.side-foot form { margin: 0; }

.main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar h1 { font-size: 1.7rem; }
.topbar .spacer { flex: 1; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px;
    background: var(--paper); border: 2px solid var(--line); border-radius: 99px;
    font-size: .85rem; font-weight: 700; white-space: nowrap; text-decoration: none;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); border: 1.5px solid var(--line); }
.chip.on { background: var(--yellow); box-shadow: var(--shadow-sm); }
.chip.green { background: var(--green-soft); }
.chip.pink { background: var(--pink-soft); }
.chip.blue { background: var(--blue-soft); }
.chip.orange { background: var(--orange-soft); }

/* ——— البطاقات ——— */
.card {
    position: relative; background: var(--paper);
    border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px;
}
.card.cream { background: var(--cream); }
.card.sky { background: var(--sky); }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h2 { font-size: 1.2rem; }
.card-h .spacer { flex: 1; }
.tag {
    position: absolute; top: -14px; inset-inline-start: 18px;
    padding: 1px 14px; border: 2.5px solid var(--line); border-radius: 99px;
    background: var(--yellow); font-weight: 800; font-size: .85rem;
}
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ——— بطاقة صقر ——— */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 22px 26px 0; overflow: hidden; background: linear-gradient(180deg, var(--sky), #eef7ff); }
.hero .say { align-self: center; padding-bottom: 22px; }
.hero h1 { font-size: 2rem; }
.hero .bubble {
    position: relative; display: inline-block; margin-top: 12px; padding: 10px 16px; max-width: 560px;
    background: var(--paper); border: 2.5px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); font-weight: 600;
}
.hero .saqr { width: 240px; height: 290px; display: block; margin-bottom: -4px; object-fit: cover; object-position: top; filter: drop-shadow(0 6px 0 rgba(43, 42, 51, .12)); }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ——— الأرقام ——— */
.stat { display: flex; align-items: center; gap: 14px; }
.stat .badge { width: 54px; height: 54px; flex: none; display: grid; place-items: center; border: 3px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); font-size: 1.5rem; }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; }
.stat span { color: var(--ink-2); font-weight: 600; font-size: .9rem; }

/* ——— المهامّ ——— */
.tasks { display: grid; gap: 10px; }
.task {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
    padding: 10px 12px; background: var(--paper); border: 2.5px solid var(--line); border-radius: 16px;
}
.task.done .t-title { text-decoration: line-through; color: var(--ink-2); }
.task.late { background: var(--pink-soft); }
.task form { margin: 0; }
.check-btn {
    width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer;
    background: var(--paper); border: 2.5px solid var(--line); border-radius: 10px; color: transparent;
}
.check-btn:hover { background: var(--green-soft); color: var(--green); }
.task.done .check-btn { background: var(--green); color: #fff; }
.check-btn svg { width: 18px; height: 18px; }
.t-title { font-weight: 700; }
.t-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: .8rem; }
.t-meta .chip { padding: 0 9px; font-size: .75rem; border-width: 1.5px; }
.prio-high { background: var(--pink-soft) !important; }
.prio-low { background: var(--sky) !important; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.col-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.col-h .count { margin-inline-start: auto; }

details.edit > summary { list-style: none; cursor: pointer; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] { grid-column: 1 / -1; }
.edit-box { margin-top: 10px; padding-top: 10px; border-top: 2px dashed var(--line); }

/* ——— النماذج ——— */
.form { display: grid; gap: 12px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
label.f { display: grid; gap: 4px; font-weight: 700; font-size: .9rem; }
.input, select.input, textarea.input {
    width: 100%; padding: 9px 12px; font: inherit; color: inherit;
    background: var(--paper); border: 2.5px solid var(--line); border-radius: 14px; outline: none;
}
.input:focus { background: var(--yellow-soft); }
textarea.input { min-height: 80px; resize: vertical; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
    padding: 9px 18px; font: inherit; font-weight: 800; color: var(--ink); text-decoration: none;
    background: var(--yellow); border: 2.5px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
    transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: var(--paper); }
.btn.green { background: var(--green); color: #fff; }
.btn.pink { background: var(--pink-soft); }
.btn.sm { padding: 4px 12px; font-size: .85rem; border-width: 2px; }
.btn.block { width: 100%; }
.icon-btn { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--ink); }
.icon-btn:hover { background: var(--yellow-soft); }
.icon-btn svg { width: 16px; height: 16px; }
.err { color: #c81e4b; font-weight: 700; font-size: .85rem; }
.flash { padding: 10px 16px; font-weight: 700; background: var(--green-soft); border: 2.5px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }

/* ——— التقويم ——— */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { text-align: center; font-weight: 800; font-size: .85rem; color: var(--ink-2); }
.cal a.day {
    display: flex; flex-direction: column; gap: 3px; min-height: 92px; padding: 6px 7px; text-decoration: none;
    background: var(--paper); border: 2px solid var(--line); border-radius: 14px; overflow: hidden;
}
.cal a.day.out { opacity: .4; }
.cal a.day.today { background: var(--yellow-soft); }
.cal a.day.sel { box-shadow: var(--shadow-sm); border-width: 3px; }
.cal .num { font-weight: 800; font-size: .95rem; }
.cal .pill { font-size: .72rem; font-weight: 700; padding: 0 6px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1.5px solid var(--line); }
.cal .pill.ev { background: var(--blue-soft); }
.cal .pill.tk { background: var(--green-soft); }
.agenda { display: grid; gap: 10px; }
.ag { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; background: var(--paper); border: 2.5px solid var(--line); border-radius: 16px; }
.ag time { font-weight: 800; text-align: center; padding: 2px 6px; background: var(--blue-soft); border: 2px solid var(--line); border-radius: 10px; font-size: .85rem; }

/* ——— التقارير ——— */
.report-body { white-space: pre-line; font-size: 1.05rem; line-height: 1.9; }
.player { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--yellow-soft); border: 2.5px solid var(--line); border-radius: 18px; }
.player img { width: 56px; height: 56px; border-radius: 50%; border: 2.5px solid var(--line); background: var(--sky); object-fit: cover; object-position: top; }
.player audio { flex: 1; min-width: 0; height: 40px; }
.list { display: grid; gap: 10px; }
.list a.item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-decoration: none; background: var(--paper); border: 2.5px solid var(--line); border-radius: 16px; }
.list a.item:hover { background: var(--yellow-soft); }

.empty { display: grid; justify-items: center; gap: 8px; padding: 26px 10px; text-align: center; color: var(--ink-2); font-weight: 600; }
.empty img { width: 90px; }

/* ——— صفحات الدخول ——— */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(440px, 100%); padding: 26px; text-align: center; }
.auth-card .saqr { width: 130px; margin: -80px auto 4px; display: block; border-radius: 50%; background: var(--sky); border: 3px solid var(--line); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 4px; }
.auth-card .form { text-align: start; margin-top: 18px; }
.code-input { text-align: center; letter-spacing: .5em; font-size: 1.6rem; font-weight: 800; direction: ltr; }
.qr { display: inline-block; padding: 10px; background: #fff; border: 3px solid var(--line); border-radius: 18px; margin: 10px 0; }
.qr svg { display: block; width: 200px; height: 200px; }
.secret { font-family: ui-monospace, monospace; font-size: .85rem; direction: ltr; background: var(--cream); padding: 4px 10px; border: 2px dashed var(--line); border-radius: 10px; display: inline-block; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; direction: ltr; }
.codes code { padding: 6px; background: var(--cream); border: 2px solid var(--line); border-radius: 10px; font-weight: 700; }
.steps { text-align: start; margin: 8px 0 0; padding-inline-start: 20px; color: var(--ink-2); font-weight: 600; }

/* ——— الجوّال ——— */
.mobile-bar { display: none; }
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
    .app { grid-template-columns: minmax(0, 1fr); padding: 12px 12px 90px; }
    .side { display: none; }
    .mobile-bar {
        display: flex; justify-content: space-around; position: fixed; inset-inline: 10px; bottom: 10px; z-index: 20;
        padding: 6px; background: var(--cream); border: 3px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
    }
    .mobile-bar a { display: grid; justify-items: center; gap: 0; padding: 4px 10px; font-size: .72rem; font-weight: 800; text-decoration: none; border-radius: 14px; }
    .mobile-bar a.on { background: var(--yellow); }
    .mobile-bar svg { width: 22px; height: 22px; }
    .grid-2, .board { grid-template-columns: minmax(0, 1fr); }
    .hero { grid-template-columns: minmax(0, 1fr) auto; padding: 16px 16px 0; }
    .hero .saqr { width: 140px; height: 180px; }
    .hero h1 { font-size: 1.45rem; }
    .cal a.day { min-height: 58px; padding: 4px; }
    .cal .pill { font-size: 0; height: 6px; padding: 0; border: 0; }
    .cal .pill.ev { background: var(--blue); }
    .cal .pill.tk { background: var(--green); }
}
@media (max-width: 480px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .stat .badge { width: 42px; height: 42px; font-size: 1.2rem; }
    .stat b { font-size: 1.4rem; }
    .card { padding: 14px; }
}
