:root {
  --ink: #1f2430; --muted: #6b7280; --line: #e3e5ea; --bg: #f6f5f2; --card: #fff;
  --brand: #6b1d2a; --brand-2: #8f2b3c; --ok: #1d7a46; --warn: #b45309; --bad: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 1.5rem; margin: 6px 0 14px; }
h2 { font-size: 1.1rem; margin: 24px 0 10px; }
h2 small { color: var(--muted); font-weight: 400; margin-left: 6px; }
a { color: var(--brand); }
.muted { color: var(--muted); } .small { font-size: .85rem; }

/* Header */
.top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 10px 18px; background: var(--brand); color: #fff; }
.login h1 { font-family: Georgia, serif; font-weight: 400; letter-spacing: .04em; color: var(--brand); }
.brand { display: flex; align-items: center; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.1rem; }


.top nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.top nav a { color: #f3dfe2; text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.top nav a.on, .top nav a:hover { background: rgba(255,255,255,.15); color: #fff; }
.who { display: flex; gap: 12px; align-items: center; }
.who a { color: #fff; text-decoration: none; }
.who small { background: rgba(255,255,255,.2); padding: 1px 6px; border-radius: 10px; font-size: .7rem; text-transform: uppercase; }
.who .link { color: #f3dfe2; }

/* Controls */
.btn { display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #c9ccd3; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }
form { margin: 0; }
label { display: block; margin-bottom: 12px; font-weight: 500; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid #cfd3da; border-radius: 8px; background: #fff; }
label input, label select { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
input[type=checkbox] { width: 18px; height: 18px; }
input[type=color] { padding: 2px; width: 44px; height: 34px; }
.row { display: flex; gap: 12px; } .row label { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: #e7f5ec; color: var(--ok); border: 1px solid #bfe3cd; }
.flash.err { background: #fdecea; color: var(--bad); border-color: #f6c7c2; }

/* Login */
.login { max-width: 360px; margin: 8vh auto 0; text-align: center; }
.login form { text-align: left; } .login .btn { width: 100%; }
.narrow { max-width: 420px; }

/* My shifts */
.admin-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pill { background: #fff; border: 1px solid var(--line); padding: 5px 12px; border-radius: 20px; text-decoration: none; font-size: .9rem; }
.pill.warn { background: #fff4e5; border-color: #f5d4a6; color: var(--warn); font-weight: 600; }
.days { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.days li { display: flex; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--line); align-items: center; }
.days li:first-child { border-top: 0; }
.days li.today { background: #fbf1f2; box-shadow: inset 4px 0 0 var(--brand); }
.days li.past { opacity: .55; }
.dname { width: 62px; font-weight: 600; line-height: 1.15; } .dname small { color: var(--muted); font-weight: 400; }
.dshift b { font-size: 1.05rem; }
.total { text-align: right; margin: 6px 4px 0; }

/* Week grid */
.weekhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.weekhead h1 { margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 6px; }
.status { padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: .9rem; margin-right: auto; }
.status.pub { background: #e7f5ec; color: var(--ok); } .status.draft { background: #fff4e5; color: var(--warn); }
.hint { margin: 4px 0 10px; }
.gridwrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; }
.grid { border-collapse: collapse; width: 100%; min-width: 760px; }
.grid th, .grid td { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; text-align: center; vertical-align: middle; }
.grid thead th { background: #faf9f7; font-weight: 600; } .grid thead small { color: var(--muted); font-weight: 400; }
.grid tbody th { text-align: left; padding-left: 12px; white-space: nowrap; border-left: 0; }
.grid tr.mine th { color: var(--brand); }
.grid tr.mine td, .grid tr.mine th { background: #fdf7f8; }
.grid .today { background: #fbf1f2 !important; }
.grid td.hrs { font-weight: 600; color: var(--muted); }
.grid td.edit { padding: 3px; }
.cellbtn { width: 100%; min-height: 44px; border: 1px dashed transparent; background: none; border-radius: 6px; cursor: pointer; font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.cellbtn:hover { border-color: #c9ccd3; background: #fafafa; }
.chip { display: inline-block; background: #e8eef7; border-radius: 6px; padding: 3px 8px; font-weight: 600; white-space: nowrap; font-size: .92rem; }
.chip b { font-weight: 700; margin-left: 2px; }
.off { color: #a3a8b3; }
.leave { display: block; font-size: .72rem; font-weight: 600; color: var(--ok); }
.leave.pending { color: var(--warn); }
.note { display: block; font-size: .72rem; color: var(--muted); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend { list-style: none; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; font-size: .9rem; margin-top: 14px; }

dialog { border: 0; border-radius: 14px; padding: 20px; width: min(440px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20,20,30,.45); }
dialog h2 { margin-top: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.dlgbtns { display: flex; gap: 8px; align-items: center; }
.dlgbtns .link { margin-left: auto; }

/* Notes */
.weeknote { background: #fffbea; border: 1px solid #f1e3a6; border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.weeknote p { margin: 4px 0 0; }
.weeknote label { margin-bottom: 8px; }
textarea { font: inherit; padding: 8px 10px; border: 1px solid #cfd3da; border-radius: 8px; width: 100%; display: block; margin-top: 4px; font-weight: 400; resize: vertical; }
.notesrow th, .notesrow td { background: #fffbea; }
.daynote { display: block; font-size: .8rem; line-height: 1.3; color: #6b5a12; text-align: left; }
.daynote.home { margin-left: auto; max-width: 45%; text-align: right; background: #fffbea; border-radius: 6px; padding: 3px 8px; }
.addnote { font-size: .8rem; color: #b8a35a; }

/* Lists */
.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.list th, .list td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.list th { background: #faf9f7; font-size: .85rem; color: var(--muted); }
.list input:not([type=checkbox]):not([type=color]) { width: 100%; }
.list .num { width: 70px !important; }
.list tr.inactive td { opacity: .5; }
.list tr.newrow td { background: #fcfbf9; }
.tag { padding: 2px 8px; border-radius: 10px; font-size: .8rem; font-weight: 600; }
.tag.pending { background: #fff4e5; color: var(--warn); } .tag.approved { background: #e7f5ec; color: var(--ok); } .tag.declined { background: #fdecea; color: var(--bad); }
.req { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.req .acts { display: flex; gap: 8px; }

@media (max-width: 640px) {
  .top { padding: 10px 12px; gap: 8px; }
  .top nav { order: 3; flex: 1 1 100%; }
  .who { margin-left: auto; }
  .row { flex-direction: column; gap: 0; }
  .list.staff, .list.staff tbody, .list.staff tr { display: block; }
  .list.staff tr:first-child { display: none; }
  .list.staff tr { padding: 8px; border-bottom: 1px solid var(--line); }
  .list.staff td { display: inline-block; border: 0; padding: 4px; }
}

@media print {
  .top, .toolbar, .hint, .weekhead .btn, .flash { display: none !important; }
  body { background: #fff; } main { padding: 0; max-width: none; }
  .gridwrap { border: 0; } .grid { min-width: 0; }
  .grid th, .grid td { border: 1px solid #999; }
  .cellbtn { min-height: 0; }
}
.grid .daynote { max-width: 120px; margin: 0 auto; text-align: center; }
.grid .notebtn { min-height: 38px; }
@media print { .weeknote.edit .btn { display: none; } .weeknote textarea { border: 0; padding: 0; resize: none; } .addnote { visibility: hidden; } }

/* ---- Logo styling ---- */
.top .brand { display: flex; align-items: center; gap: 0; text-decoration: none; }
.logo-top { height: 34px; width: auto; margin-right: 14px; padding-right: 14px; border-right: 1px solid rgba(255,255,255,.3); filter: brightness(0) invert(1); }
.bname { display: flex; flex-direction: column; line-height: 1.1; font-family: "Cormorant Garamond", Garamond, "Times New Roman", Georgia, serif; }
.bl1 { font-size: .95rem; letter-spacing: .28em; text-transform: uppercase; font-variant: small-caps; font-weight: 500; }
.bl2 { font-size: .72rem; letter-spacing: .32em; text-transform: uppercase; color: #e9c9cf; margin-top: 3px; font-family: system-ui, sans-serif; }

.login { max-width: 380px; margin-top: 6vh; }
.crest { background: #fff; border: 1px solid var(--line); border-radius: 16px 16px 0 0; border-bottom: 0; padding: 34px 24px 22px; box-shadow: 0 1px 0 #fff; }
.logo-login { display: block; width: 230px; max-width: 75%; height: auto; margin: 0 auto; }
.crest-text { font-family: Georgia, serif; letter-spacing: .3em; text-transform: uppercase; font-size: 1.1rem; }
.rule { display: flex; align-items: center; gap: 12px; margin-top: 22px; color: #8a6d3b; }
.rule span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #c8a96a, transparent); }
.rule i { font-style: normal; font-size: .72rem; letter-spacing: .35em; text-transform: uppercase; color: #6b5a3a; }
.login form.card { border-radius: 0 0 16px 16px; border-top: 1px solid #efe7d6; margin-top: 0; padding: 22px 24px 24px; }
.login .flash { margin: 0 0 0; border-radius: 0; }
@media (max-width: 640px) { .bl1 { font-size: .8rem; letter-spacing: .2em; } .bl2 { font-size: .62rem; } .logo-top { height: 30px; } }

/* ---- Week notice card ---- */
.notice { position: relative; background: #fffdf7; border: 1px solid #eadfc6; border-left: 4px solid #c8a96a; border-radius: 12px; padding: 14px 18px 12px; margin: 14px 0; box-shadow: 0 1px 3px rgba(80,60,20,.06); }
.notice-head { display: flex; align-items: center; gap: 8px; color: #8a6d3b; }
.notice-head h3 { margin: 0; font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; flex: 1; }
.notice-head .btn { margin-left: auto; }
.notice-list { margin: 10px 0 2px; padding: 0; list-style: none; }
.notice-list li { position: relative; padding: 5px 0 5px 20px; border-top: 1px dashed #eee3cc; font-size: .98rem; }
.notice-list li:first-child { border-top: 0; }
.notice-list li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: #c8a96a; }
.notice-empty { margin: 8px 0 2px; color: var(--muted); font-size: .9rem; }
.notice-form { margin-top: 10px; }
.notice-form p { margin: 6px 0 10px; }
@media print { .notice { box-shadow: none; } .notice-head .btn { display: none; } }
[hidden] { display: none !important; }
