/* Owner portal */
:root { --ink:#16130f; --ink-2:#3a342c; --muted:#6f665a; --bg:#f4f1ea; --card:#fff; --line:#e0d8c8; --red:#a8231c; --red-deep:#7d1812; --ok:#2d6a1e; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font:15px/1.55 "Inter", system-ui, sans-serif; }
a { color: var(--red); }
h1 { font-size:1.6rem; margin:0 0 4px; }
h2 { font-size:1.15rem; margin:0 0 12px; }
.top { background:var(--ink); color:#efe8da; }
.top .in { max-width:1080px; margin:0 auto; padding:0 20px; height:60px; display:flex; align-items:center; gap:20px; }
.top .logo { font-weight:700; letter-spacing:.02em; margin-right:auto; color:#fff; text-decoration:none; }
.top .logo small { color:#a79e8f; font-weight:500; margin-left:6px; }
.top nav { display:flex; gap:4px; flex-wrap:wrap; }
.top nav a, .top nav button { color:#d9d0c0; text-decoration:none; padding:7px 12px; border-radius:8px; font:500 .92rem inherit; background:none; border:0; cursor:pointer; font-family:inherit; }
.top nav a:hover, .top nav button:hover, .top nav a.on { background:#2e2922; color:#fff; }
.badge { background:var(--red); color:#fff; border-radius:999px; padding:1px 7px; font-size:.75rem; margin-left:4px; }
.main { max-width:1080px; margin:0 auto; padding:28px 20px 60px; }
.head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:22px; flex-wrap:wrap; }
.head p { margin:0; color:var(--muted); }
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:22px; margin-bottom:18px; }
.btn { display:inline-flex; align-items:center; gap:6px; padding:9px 16px; border-radius:9px; border:0; font:600 .92rem inherit; font-family:inherit; cursor:pointer; text-decoration:none; background:var(--ink); color:#fff; }
.btn:hover { background:var(--ink-2); color:#fff; }
.btn.red { background:var(--red); } .btn.red:hover { background:var(--red-deep); }
.btn.ghost { background:transparent; color:var(--ink); box-shadow:inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background:var(--bg); }
.btn.danger { background:transparent; color:var(--red); box-shadow:inset 0 0 0 1px #e6c4c0; }
.btn.danger:hover { background:#fbeceb; }
.btn.sm { padding:6px 11px; font-size:.85rem; }
.icon-btn { background:none; border:1px solid var(--line); border-radius:7px; width:30px; height:30px; cursor:pointer; color:var(--ink-2); font-size:.9rem; }
.icon-btn:hover:not(:disabled) { background:var(--bg); }
.icon-btn:disabled { opacity:.35; cursor:default; }
.flash { padding:12px 16px; border-radius:9px; margin-bottom:16px; font-weight:500; }
.flash.ok { background:#e5f0de; color:var(--ok); }
.flash.error { background:#f9e2df; color:var(--red-deep); }

/* Class list */
.class-row { display:grid; grid-template-columns:auto 1fr auto; gap:16px; align-items:center; padding:16px 0; border-bottom:1px solid var(--line); }
.class-row:last-child { border-bottom:0; }
.class-row .order { display:flex; flex-direction:column; gap:4px; }
.class-row .name { font-weight:700; font-size:1.05rem; }
.class-row .sub { color:var(--muted); font-size:.88rem; }
.class-row .times { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.chip { background:var(--bg); border-radius:999px; padding:3px 10px; font-size:.82rem; }
.chip.off { background:#f3e3cc; color:#7a5414; }
.class-row .acts { display:flex; gap:8px; }
@media (max-width:640px) { .class-row { grid-template-columns:1fr; } .class-row .order { flex-direction:row; } }

/* Mini timetable */
.mini-tt { display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:10px; }
.mini-tt div h3 { font-size:.72rem; letter-spacing:.14em; text-transform:uppercase; color:var(--muted); margin:0 0 6px; }
.mini-tt div p { margin:0 0 6px; font-size:.84rem; padding:6px 8px; background:var(--bg); border-left:3px solid var(--red); border-radius:6px; }
.mini-tt small { color:var(--muted); display:block; }

/* Forms */
label { display:block; font-weight:600; font-size:.88rem; margin:0 0 5px; }
.hint { font-weight:400; color:var(--muted); font-size:.82rem; }
input[type=text], input[type=password], input[type=email], input[type=time], input[type=url], textarea {
  width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:8px; font:inherit; background:#fff; color:var(--ink); }
input:focus, textarea:focus { outline:2px solid var(--red); outline-offset:0; border-color:transparent; }
.field { margin-bottom:16px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.grid3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }
@media (max-width:640px) { .grid2, .grid3 { grid-template-columns:1fr; } }
.check { display:flex; align-items:center; gap:8px; font-weight:500; }
.check input { width:18px; height:18px; accent-color:var(--red); }

/* Session editor */
.slot { border:1px solid var(--line); border-radius:10px; padding:14px; margin-bottom:12px; background:#fcfbf8; }
.slot .r1 { display:grid; grid-template-columns:1.3fr 1fr 1fr auto; gap:12px; align-items:end; }
.days { display:flex; gap:6px; flex-wrap:wrap; margin-top:12px; }
.days label { margin:0; }
.days input { position:absolute; opacity:0; pointer-events:none; }
.days span { display:inline-block; min-width:48px; text-align:center; padding:7px 10px; border:1px solid var(--line); border-radius:8px; font-weight:600; font-size:.85rem; cursor:pointer; user-select:none; background:#fff; }
.days input:checked + span { background:var(--ink); color:#fff; border-color:var(--ink); }
.days input:focus-visible + span { outline:2px solid var(--red); }
@media (max-width:640px) { .slot .r1 { grid-template-columns:1fr 1fr; } .slot .r1 > :first-child { grid-column:span 2; } }
.actions { display:flex; gap:10px; justify-content:space-between; align-items:center; flex-wrap:wrap; }

/* Messages */
.msg { border-bottom:1px solid var(--line); padding:16px 0; }
.msg:last-child { border-bottom:0; }
.msg.unread .who::before { content:""; display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--red); margin-right:8px; vertical-align:middle; }
.msg .who { font-weight:700; }
.msg .meta { color:var(--muted); font-size:.85rem; }
.msg .body { white-space:pre-wrap; margin:10px 0; }
.msg form { display:inline; }

/* Login */
.login { min-height:100vh; display:grid; place-items:center; padding:20px; }
.login .card { width:100%; max-width:380px; padding:32px; }
.login .logo { text-align:center; margin-bottom:20px; }
.login .logo img { width:56px; height:56px; margin:0 auto 10px; display:block; object-fit:contain; }
.empty { color:var(--muted); text-align:center; padding:30px 0; }

/* Guest instructors */
.guest-summary { display:flex; gap:14px; align-items:center; }
.thumb { width:52px; height:64px; border-radius:8px; object-fit:cover; background:var(--bg); flex:none; }
.thumb.none { display:grid; place-items:center; font-weight:700; color:var(--muted); font-size:1.2rem; }
.guest-edit { display:grid; grid-template-columns:220px 1fr; gap:28px; }
@media (max-width:640px) { .guest-edit { grid-template-columns:1fr; } }
.photo-pick .photo-frame { aspect-ratio:4/5; border-radius:10px; background:var(--bg); border:1px dashed var(--line); overflow:hidden; display:grid; place-items:center; color:var(--muted); margin-bottom:10px; }
.photo-pick .photo-frame img { width:100%; height:100%; object-fit:cover; }
.file-btn { position:relative; overflow:hidden; cursor:pointer; margin-bottom:8px; }
.file-btn input { position:absolute; inset:0; opacity:0; cursor:pointer; }
