/* ===================================================================
   מעון איריס — עיצוב ומיתוג. כל ה-UI RTL, עברית.
   הפלטה לפי פרק 3.2 באפיון. אדום בשימוש חסכוני בלבד.
   =================================================================== */

/* --- גופנים (variable fonts, מוטמעים מקומית — CSP מחמיר, ללא CDN חיצוני) --- */
@font-face {
  font-family: "Heebo"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/heebo.woff2") format("woff2");
}
@font-face {
  font-family: "Assistant"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/static/fonts/assistant.woff2") format("woff2");
}

:root {
  /* ===== מותג מעון איריס ===== */
  --brand-blue:        #1F5FA8;
  --brand-blue-dark:   #16467E;
  --brand-blue-tint:   #EAF1FA;
  --brand-red:         #D62F2F;
  --brand-red-dark:    #B02525;

  /* ===== נייטרלים ===== */
  --bg:                #F7F8FA;
  --surface:           #FFFFFF;
  --text:              #1A1F2B;
  --text-muted:        #5B6472;
  --border:            #E2E6EC;

  /* ===== סטטוס ===== */
  --status-ok:         #2E9E5B;
  --status-warn:       #E08A1E;
  --status-danger:     #D62F2F;

  --radius:            12px;
  --radius-sm:         8px;
  --shadow:            0 1px 3px rgba(26,31,43,.06), 0 4px 16px rgba(26,31,43,.05);
  --shadow-lg:         0 8px 32px rgba(26,31,43,.12);
  --font:              "Assistant", "Heebo", system-ui, "Segoe UI", Arial, sans-serif;
  --font-head:         "Heebo", "Assistant", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; color: var(--text); margin: 0 0 .5em; }
a { color: var(--brand-blue); text-decoration: none; }
a:hover { color: var(--brand-blue-dark); text-decoration: underline; }

/* =================== Layout =================== */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.app-header .bar {
  max-width: 1120px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--brand-blue); }
.brand .logo {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--brand-blue); color: #fff;
  display: grid; place-items: center; font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--brand-red);
}
.brand .logo-img { height: 40px; width: auto; max-width: 160px; object-fit: contain; display: block; }
.brand-big { flex-direction: column; gap: 4px; }
.brand-big .logo-img { height: 76px; max-width: 240px; }
.brand-big .logo { width: 44px; height: 44px; font-size: 1.1rem; }
.app-header nav { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.app-header nav a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 600; }
.app-header nav a:hover { background: var(--brand-blue-tint); color: var(--brand-blue); text-decoration: none; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: .92rem; font-weight: 600;
  margin-inline-start: 6px; padding-inline-start: 14px; border-inline-start: 1px solid var(--border); }

.container { max-width: 1120px; margin: 0 auto; padding: 28px 24px 64px; }
.page-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.page-sub { color: var(--text-muted); margin: 0 0 24px; }

/* כותרת עמוד עם כפתורי פעולה */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 22px; }
.page-header .titles h1 { margin: 0 0 4px; }
.page-header .titles .page-sub { margin: 0; }
.page-header .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* רשת כרטיסים */
.card-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin-bottom: 16px; }
@media (max-width: 760px) { .card-grid-2 { grid-template-columns: 1fr; } }

/* =================== Cards =================== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.feature {
  display: flex; flex-direction: column; gap: 6px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); padding: 18px 18px 20px; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #cfdc ; text-decoration: none; }
.feature .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-blue-tint); color: var(--brand-blue); display: grid; place-items: center; font-size: 1.25rem; margin-bottom: 6px; }
.feature h3 { font-size: 1.05rem; margin: 0; }
.feature p { margin: 0; color: var(--text-muted); font-size: .92rem; }
.feature.locked { opacity: .62; }
.feature .soon { font-size: .72rem; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; align-self: flex-start; margin-top: 6px; }

/* =================== Forms =================== */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(1200px 600px at 80% -10%, var(--brand-blue-tint), transparent),
  var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px; }
.auth-card .brand { justify-content: center; font-size: 1.3rem; margin-bottom: 4px; }
.auth-card .logo { width: 44px; height: 44px; font-size: 1.1rem; }
.auth-title { text-align: center; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--text-muted); margin: 0 0 24px; font-size: .95rem; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--text); }
.field input {
  width: 100%; padding: 11px 13px; font-family: inherit; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); transition: border-color .12s, box-shadow .12s;
}
.field input:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(31,95,168,.15); }
.field input[inputmode="numeric"] { letter-spacing: .35em; text-align: center; font-size: 1.3rem; font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-weight: 700; font-size: .95rem; line-height: 1; cursor: pointer;
  padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  white-space: nowrap; transition: background .12s, transform .05s, box-shadow .12s;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }                 /* רוחב מלא — לטפסים (login) */
.btn-sm { padding: 7px 12px; font-size: .88rem; }
.btn-primary { background: var(--brand-blue); color: #fff; }
.btn-primary:hover { background: var(--brand-blue-dark); text-decoration: none; color:#fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: #fff; color: var(--brand-red-dark); border-color: #F3C4C4; }
.btn-danger:hover { background: #FDECEC; color: var(--brand-red-dark); text-decoration: none; }

/* אזור ניהול בכרטיס */
.manage-card { border-color: #F3D9B5; background: #FFFCF7; }
.manage-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.manage-move { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.manage-move .ge-field { min-width: 220px; }

/* =================== Alerts =================== */
.alert { border-radius: var(--radius-sm); padding: 11px 14px; font-size: .92rem; margin-bottom: 18px; border: 1px solid; }
.alert-error { background: #FDECEC; border-color: #F3C4C4; color: var(--brand-red-dark); }
.alert-info  { background: var(--brand-blue-tint); border-color: #C9DCF1; color: var(--brand-blue-dark); }

/* =================== 2FA setup =================== */
.secret-box { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1.15rem; letter-spacing: .15em;
  background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius-sm);
  padding: 12px; text-align: center; user-select: all; margin: 6px 0 4px; word-break: break-all; }
.muted { color: var(--text-muted); font-size: .9rem; }
.center { text-align: center; }

/* =================== Tables =================== */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
th.sortable, table.data thead th { cursor: pointer; }
table.data thead th[data-nosort] { cursor: default; }
table.data { width: 100%; border-collapse: collapse; font-size: .94rem; }
table.data thead th { background: var(--brand-blue-tint); color: var(--brand-blue-dark); text-align: right; font-weight: 700; padding: 11px 14px; white-space: nowrap; border-bottom: 1px solid var(--border); }
table.data tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--brand-blue-tint); }
table.data .num { color: var(--text-muted); font-variant-numeric: tabular-nums; width: 1%; }
table.data a { font-weight: 600; }
.pill { display: inline-block; font-size: .76rem; font-weight: 700; border-radius: 999px; padding: 1px 9px; }
.pill-mother { background: #FCE7F0; color: #B0246A; }
.pill-father { background: var(--brand-blue-tint); color: var(--brand-blue-dark); }
.pill-other  { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.pill-warn   { background: #FCEFD8; color: var(--brand-red-dark); }
.tel { direction: ltr; unicode-bidi: embed; font-variant-numeric: tabular-nums; }
.allergy-dot { color: var(--status-danger); font-weight: 700; }

/* =================== Child card =================== */
.section-h { display: flex; align-items: center; gap: 8px; font-size: 1.02rem;
  border-bottom: 2px solid var(--brand-blue-tint); padding-bottom: 8px; margin: 0 0 14px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 9px 14px; align-items: baseline; }
.kv dt { color: var(--text-muted); font-weight: 600; }
.kv dd { margin: 0; word-break: break-word; }
.card-section { margin-bottom: 20px; }
.card-section h3 { font-size: 1rem; border-bottom: 2px solid var(--brand-blue-tint); padding-bottom: 6px; margin-bottom: 12px; }
.sensitive { background: #FFF8F0; border: 1px solid #F3D9B5; border-radius: var(--radius-sm); padding: 12px 14px; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--text-muted); font-weight: 600; }
.guardian-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.guardian-row:last-child { border-bottom: none; }
.guardian-info { flex: 1; min-width: 0; }
.guardian-name { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.pill-ok { background: #E3F4EA; color: #1E7A45; }
.pill-primary { background: var(--brand-blue-tint); color: var(--brand-blue-dark); }
.btn-call { background: var(--status-ok); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; }
.btn-call:hover { background: #25814a; color: #fff; text-decoration: none; }
.btn-call.btn-sm { padding: 6px 10px; }

/* תוויות קרבה */
.pill-mother      { background: #FCE7F0; color: #B0246A; }
.pill-father      { background: var(--brand-blue-tint); color: var(--brand-blue-dark); }
.pill-grandmother { background: #F3E8FB; color: #7B3FB3; }
.pill-grandfather { background: #E6F0F3; color: #1F6E7E; }
.pill-guardian    { background: #FBF0DE; color: #92681A; }

/* כותרת אזור עם רמז בצד */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 2px solid var(--brand-blue-tint); padding-bottom: 8px; margin-bottom: 14px; flex-wrap: wrap; }

/* --- אנשי קשר: תצוגה נקייה + עריכה לפי דרישה --- */
.guardian-list { display: flex; flex-direction: column; gap: 4px; }
.guardian-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.guardian-item + .guardian-item { margin-top: 8px; }
.guardian-view { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; flex-wrap: wrap; }
.gv-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gv-name { font-weight: 700; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gv-phone { color: var(--text-muted); font-size: .95rem; }
.gv-actions { display: flex; align-items: center; gap: 8px; }

/* טופס עריכה — מוסתר עד לחיצה על "עריכה" */
.guardian-item .guardian-form { display: none; }
.guardian-item.editing .guardian-view { display: none; }
.guardian-item.editing .guardian-form { display: block; }
.guardian-form { padding: 16px; border-top: 1px solid var(--border); }
.guardian-form .gf-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 14px; align-items: end; }
.guardian-form .field { margin: 0; }
.guardian-form .field label { font-size: .8rem; }
.guardian-form .field input, .guardian-form .field select { padding: 9px 11px; font-size: .95rem; }
.gf-primary { display: flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 600; margin: 12px 0 0; }
.gf-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.add-form { display: block; margin-top: 16px; background: var(--brand-blue-tint); border: 1px solid #C9DCF1; border-radius: var(--radius-sm); }
.add-form h4 { margin: 0 0 12px; font-size: .98rem; color: var(--brand-blue-dark); }
.add-form.is-hidden { display: none; }
.is-hidden { display: none !important; }
@media (max-width: 720px) { .guardian-form .gf-grid { grid-template-columns: 1fr; } }

/* =================== Edit form =================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field textarea, .field select { width: 100%; padding: 11px 13px; font-family: inherit; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: var(--text); }
.field textarea:focus, .field select:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(31,95,168,.15); }
.field textarea { min-height: 72px; resize: vertical; }

/* סלקט מעוצב אחיד (לא native) עם חץ בצד שמאל (RTL) */
select { appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235B6472' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 13px center; padding-left: 34px !important; }
select:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(31,95,168,.15); }
.field .sens-tag { font-size: .72rem; color: var(--brand-red-dark); font-weight: 700; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #eef0f3; text-decoration: none; color: var(--text); }

/* =================== Modal =================== */
.modal-overlay { position: fixed; inset: 0; background: rgba(26,31,43,.55); display: none;
  align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  max-width: 460px; width: 100%; padding: 26px; }
.modal h2 { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.modal .warn-ico { width: 36px; height: 36px; border-radius: 9px; background: #FDECEC; color: var(--brand-red);
  display: grid; place-items: center; font-size: 1.2rem; }
.modal p { color: var(--text-muted); }
.modal .field { margin-top: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.inline-err { color: var(--brand-red-dark); font-size: .85rem; margin-top: 6px; display: none; }
.inline-err.show { display: block; }

/* =================== History =================== */
.diff-old { color: var(--brand-red-dark); text-decoration: line-through; }
.diff-new { color: var(--status-ok); font-weight: 600; }
.diff-arrow { color: var(--text-muted); margin: 0 6px; }

/* =================== Excel button =================== */
.btn-excel { display: inline-flex; align-items: center; gap: 7px; background: #1D6F42; color: #fff;
  padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 700; font-size: .9rem; border: none; cursor: pointer; }
.btn-excel:hover { background: #15572f; text-decoration: none; color: #fff; }
.btn-excel svg { width: 18px; height: 18px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.hint { color: var(--text-muted); font-size: .85rem; margin: 0 0 12px; }

/* =================== Sortable headers =================== */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { background: #dce8f6; }
th.sortable .arrow { color: var(--brand-blue); font-size: .8rem; margin-inline-start: 4px; opacity: .9; }

/* =================== Billing =================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.stat .label { color: var(--text-muted); font-size: .85rem; font-weight: 600; }
.stat .value { font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; color: var(--brand-blue); margin-top: 2px; }
.stat.danger .value { color: var(--brand-red); }
.stat.ok .value { color: var(--status-ok); }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }

.st { display: inline-block; font-size: .76rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.st-paid     { background: #E3F4EA; color: #1E7A45; }
.st-overdue  { background: #FDECEC; color: var(--brand-red-dark); }
.st-partial  { background: #FCEFD8; color: #9A5B12; }
.st-pending  { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.st-waived   { background: #EFEAF6; color: #6A4BA0; }
.st-missing  { background: #FDECEC; color: var(--brand-red-dark); }
.st-held     { background: #FCEFD8; color: #9A5B12; }

.subform { background: var(--brand-blue-tint); border: 1px solid #C9DCF1; border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.subform h3 { margin-top: 0; }
.inline-form { display: inline; }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.btn-mini { font-size: .78rem; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; color: var(--text-muted); cursor: pointer; font-weight: 600; }
.btn-mini:hover { background: var(--bg); }
.btn-mini.danger:hover { background: #FDECEC; color: var(--brand-red-dark); border-color: #F3C4C4; }

/* =================== Certificates compliance =================== */
.compliance-cell { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start; background: var(--surface); }
.compliance-cell.st-paid { border-inline-start: 4px solid var(--status-ok); }
.compliance-cell.st-partial { border-inline-start: 4px solid var(--status-warn); }
.compliance-cell.st-overdue { border-inline-start: 4px solid var(--brand-red); background: #FFF8F8; }
.compliance-cell.st-pending { border-inline-start: 4px solid var(--border); }
.cc-cat { font-weight: 700; }

/* =================== Charts =================== */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.charts-grid .card { min-width: 0; }
.charts-grid canvas { max-width: 100%; }
@media (max-width: 820px) { .charts-grid { grid-template-columns: 1fr; } }

/* =================== Misc =================== */
.badge { display: inline-block; font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.badge-admin { background: var(--brand-blue); color: #fff; }
.badge-teacher { background: var(--brand-blue-tint); color: var(--brand-blue-dark); }
.logout-form { display: inline; }
.logout-form button { background: none; border: none; color: var(--text-muted); font: inherit; font-weight: 600; cursor: pointer; padding: 8px 12px; border-radius: var(--radius-sm); }
.logout-form button:hover { background: #FDECEC; color: var(--brand-red-dark); }

/* =================== ספריית מוזיקה (שלב 6) =================== */
body.has-player { padding-bottom: 96px; }  /* מקום לנגן הקבוע */

.music-search { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.music-search input[type="search"] { flex: 1; min-width: 220px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font: inherit; }

.music-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 18px; }
.filter-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-label { font-size: .8rem; font-weight: 700; color: var(--text-muted); margin-inline-end: 2px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 600;
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px;
  background: var(--surface); color: var(--text-muted); }
.chip:hover { background: var(--brand-blue-tint); color: var(--brand-blue-dark); }
.chip-active { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }
.chip-active:hover { background: var(--brand-blue-dark); color: #fff; }
.chip-count { font-size: .72rem; opacity: .75; }

.track-list { list-style: none; margin: 0; padding: 0; }
.track-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px;
  border-bottom: 1px solid var(--border); }
.track-row:last-child { border-bottom: none; }
.track-row.playing { background: var(--brand-blue-tint); border-radius: var(--radius-sm); }
.track-play { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--brand-blue); background: #fff; color: var(--brand-blue);
  font-size: .9rem; cursor: pointer; display: grid; place-items: center; }
.track-play:hover { background: var(--brand-blue); color: #fff; }
.track-main { flex: 1; min-width: 0; }
.track-title { font-weight: 700; color: var(--text); }
.track-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.badge-cat { background: var(--brand-blue-tint); color: var(--brand-blue-dark);
  font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 1px 9px; }
.track-tags { font-style: italic; }
.track-dur { flex: 0 0 auto; font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: .85rem; }

.player-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px; padding: 10px 18px;
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.player-now { flex: 0 0 auto; min-width: 140px; max-width: 30%; }
.pn-title { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-artist { font-size: .8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-controls { flex: 1; display: flex; align-items: center; gap: 10px; }
.player-controls audio { flex: 1; height: 40px; }
.player-nav { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff; color: var(--brand-blue);
  font-size: 1rem; cursor: pointer; }
.player-nav:hover { background: var(--brand-blue-tint); }

@media (max-width: 640px) {
  .player-now { display: none; }
  .player-bar { gap: 8px; padding: 8px 10px; }
}

/* =================== מוזיקה: תיקיות, פלייליסטים, יומן (שלב 6+) =================== */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; font-size: .92rem; }
.breadcrumb a { color: var(--brand-blue); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.bc-sep { color: var(--text-muted); }

.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 18px; }
.folder-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--surface);
  display: flex; flex-direction: column; gap: 8px; }
.folder-card:hover { border-color: var(--brand-blue); box-shadow: var(--shadow); }
.folder-link { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; min-width: 0; }
.folder-link .fi { font-size: 1.25rem; }
.folder-link .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-actions { display: flex; gap: 6px; }

.add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.add-row input { flex: 1; min-width: 220px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #fff; color: var(--text); font: inherit; }

/* פלייליסט — סידור וחיתוך */
.reorder-col { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; }
.reorder-col .btn-mini { padding: 0 7px; line-height: 1.4; }
.trim-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; font-size: .82rem; }
.trim-form label { color: var(--text-muted); }
.trim-form input[type="number"] { width: 76px; padding: 4px 8px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; font: inherit; }

/* יומן פעילות */
.filter-form { display: flex; gap: 8px; align-items: center; }
.filter-select { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font: inherit; }
.detail-cell { max-width: 360px; }
td.nowrap, .nowrap { white-space: nowrap; }

/* כפתור ghost עם הדגשת מחיקה */
.btn-ghost.danger { color: var(--brand-red); }
.btn-ghost.danger:hover { background: #FDECEC; color: var(--brand-red-dark); }

/* בחירה מרובה (bulk) בתצוגת התיקיות */
.select-all { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem;
  color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.select-all input, .track-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--brand-blue); }
.track-check { flex: 0 0 auto; }
.track-row.selected { background: var(--brand-blue-tint); border-radius: var(--radius-sm); }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; position: sticky; top: 8px; z-index: 5;
  background: var(--brand-blue-tint); border: 1px solid #C9DCF1; border-radius: var(--radius-sm);
  padding: 8px 12px; margin-bottom: 12px; }
.bulk-count { font-size: .85rem; color: var(--brand-blue-dark); font-weight: 700; margin-inline-end: 4px; }
.bulk-clear { margin-inline-start: auto; }

/* תפריט ניווט נפתח (מוזיקה → כל המוזיקה / פלייליסטים) */
.nav-dropdown { position: relative; display: inline-block; }
.nav-trigger { background: none; border: none; font: inherit; font-weight: 600; color: var(--text-muted);
  cursor: pointer; padding: 8px 12px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: 4px; }
.nav-trigger:hover { background: var(--brand-blue-tint); color: var(--brand-blue); }
.nav-trigger .caret { font-size: .7rem; }
.dropdown-menu { position: absolute; top: 100%; inset-inline-end: 0; margin-top: 4px; z-index: 60;
  display: flex; flex-direction: column; gap: 2px; min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.dropdown-menu[hidden] { display: none; }
.dropdown-menu a { padding: 9px 12px; border-radius: 6px; color: var(--text); font-weight: 600;
  white-space: nowrap; text-decoration: none; }
.dropdown-menu a:hover { background: var(--brand-blue-tint); color: var(--brand-blue-dark); text-decoration: none; }

/* הדגשת שורת טבלה מסומנת (bulk) */
table.data tbody tr.selected { background: var(--brand-blue-tint); }
