:root{
  --bg:#f4f7fb;
  --card:#ffffff;
  --text:#1f2937;
  --muted:#667085;
  --border:#d9e1ea;
  --primary:#1f6feb;
  --primary-dark:#1558bd;
  --danger:#c9372c;
  --success:#176b3a;
  --shadow:0 8px 24px rgba(16,24,40,.08);
  --radius:14px;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:Inter,Segoe UI,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}
.app{max-width:1500px;margin:0 auto;padding:22px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
h1{margin:0;font-size:30px}
h2{margin-top:0}
.subtitle{margin:5px 0 0;color:var(--muted)}
.hidden{display:none!important}
.session-area{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.session-email{font-size:14px;color:var(--muted)}
.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.tab{
  border:1px solid var(--border);background:#fff;color:var(--text);
  padding:11px 18px;border-radius:10px;font-weight:700;cursor:pointer
}
.tab.active{background:var(--primary);color:#fff;border-color:var(--primary)}
.panel{display:none}.panel.active{display:block}
.card{
  background:var(--card);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:18px
}
.auth-wrap{display:flex;justify-content:center;padding-top:35px}
.auth-card{width:min(100%,420px)}
.toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.week-controls{display:flex;gap:8px;flex-wrap:wrap}
.week-title-row{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:12px}
.week-title{font-size:18px;margin:0}
.legend{display:flex;gap:8px;flex-wrap:wrap}
.legend-item{
  display:inline-flex;align-items:center;gap:7px;padding:7px 10px;border:1px solid var(--border);
  border-radius:999px;background:#fff;font-size:14px
}
.dot{width:11px;height:11px;border-radius:50%}
.schedule-wrap{overflow:auto;border:1px solid var(--border);border-radius:12px;background:#fff}
table{width:100%;border-collapse:collapse;min-width:980px}
th,td{border-right:1px solid var(--border);border-bottom:1px solid var(--border);padding:10px;vertical-align:top}
th{background:#f8fafc;text-align:left;position:sticky;top:0;z-index:1}
th:first-child,td:first-child{width:90px;min-width:90px;position:sticky;left:0;background:#f8fafc;z-index:2}
th:first-child{z-index:3}
tr:last-child td{border-bottom:0}
th:last-child,td:last-child{border-right:0}
.day-head{display:flex;flex-direction:column;gap:2px}
.day-date{font-size:12px;color:var(--muted);font-weight:500}
.event{border:1px solid var(--border);border-left-width:6px;border-radius:9px;padding:8px;margin-bottom:7px;background:#fff;min-width:130px}
.event:last-child{margin-bottom:0}
.event-name{font-weight:800}
.event-title{font-size:14px;margin-top:2px}
.event-time{font-size:12px;color:var(--muted);margin-top:3px}
.badge{display:inline-flex;align-items:center;padding:3px 7px;border-radius:999px;font-size:11px;font-weight:800;margin-top:5px;border:1px solid var(--border)}
.badge.fixed{background:#eef6ff;color:#1558bd;border-color:#c7dcfb}
.badge.temporary{background:#fff7e8;color:#9a5b00;border-color:#f1d39c}
.empty{text-align:center;color:var(--muted);padding:35px;border:2px dashed var(--border);border-radius:12px}
.grid{display:grid;grid-template-columns:380px minmax(0,1fr);gap:18px;align-items:start}
label{display:block;font-weight:700;margin-bottom:6px;font-size:14px}
.field{margin-bottom:14px}
input,select{
  width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--border);
  border-radius:9px;background:#fff;color:var(--text);font:inherit
}
input:focus,select:focus{outline:2px solid rgba(31,111,235,.18);border-color:var(--primary)}
.row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.btn{border:0;border-radius:9px;min-height:42px;padding:10px 14px;font-weight:700;cursor:pointer}
.btn:disabled{opacity:.55;cursor:not-allowed}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover:not(:disabled){background:var(--primary-dark)}
.btn-danger{background:#fff;color:var(--danger);border:1px solid #efc6c2}
.btn-soft{background:#fff;color:var(--text);border:1px solid var(--border)}
.full{width:100%}.mt8{margin-top:8px}
.list{display:flex;flex-direction:column;gap:9px}
.item{display:flex;gap:11px;align-items:center;border:1px solid var(--border);border-radius:11px;padding:11px;background:#fff}
.bar{width:5px;align-self:stretch;border-radius:99px}
.item-main{min-width:0;flex:1}
.item-title{font-weight:800}
.item-sub{color:var(--muted);font-size:13px;margin-top:3px}
.item-dates{font-size:12px;color:var(--muted);margin-top:4px}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.message{margin:8px 0 12px;padding:10px 12px;border-radius:9px;display:none;font-size:14px}
.message.error{display:block;color:#8a1c13;background:#fff2f0;border:1px solid #efc6c2}
.message.success{display:block;color:#176b3a;background:#edf9f1;border:1px solid #bfe3ca}
.small{font-size:13px;color:var(--muted)}
.sync-status{font-size:13px;color:var(--muted);margin-bottom:12px}
code{background:#f2f4f7;padding:2px 6px;border-radius:5px}
@media(max-width:900px){
  .grid{grid-template-columns:1fr}
  .app{padding:12px}
  h1{font-size:24px}
  .topbar{align-items:flex-start;flex-direction:column}
}
@media(max-width:520px){
  .row{grid-template-columns:1fr}
  .btn{min-height:44px}
}
