/* RK Media Apps Hub */
:root {
  --ink: #111111; --ink-2: #3F434B; --muted: #5B606B;
  --ground: #F6F6F3; --surface: #FFFFFF; --line: #E4E4DF; --line-2: #EEEEEA; --field: #D9D9D3;
  --blue: #0072AB; --blue-hover: #005480; --blue-logo: #008DD2; --blue-tint: #E5F3FB; --blue-ink: #005A87;
  --green: #B0CB1F; --green-tint: #F1F7D6; --green-ink: #4A5A06;
  --red: #E31E24; --red-tint: #FCE8E9; --red-ink: #B3161B;
  --orange: #EF7F1A; --orange-tint: #FDEFE2; --orange-ink: #9A4A05;
  --gray-tint: #F1F1ED;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--ground); }
a { color: var(--blue); }
a:hover { color: var(--blue-hover); }
h1, h2, h3 { font-family: "Space Grotesk", Inter, sans-serif; font-weight: 600; margin: 0; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 17px; font-family: Inter, sans-serif; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Shell: shared top bar (rk-ui.css), hub menu on the left */
.shell { display: flex; min-height: calc(100vh - 63px); }
.side { width: 232px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 63px; height: calc(100vh - 63px); overflow-y: auto; }
.side a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-2); font-size: 14px; padding: 10px 12px; border-radius: 8px; min-height: 44px; white-space: nowrap; }
.side a:hover { background: var(--gray-tint); color: var(--ink); }
.side a.on { background: var(--blue-tint); color: var(--ink); font-weight: 600; }
.side a.on svg { color: var(--blue-logo); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue-tint); color: var(--blue-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); text-decoration: none; }
.main { flex: 1; min-width: 0; padding: 32px clamp(18px, 4vw, 48px) 48px; display: flex; flex-direction: column; gap: 24px; max-width: 1240px; }
.solo { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 18px; gap: 16px;
  background: radial-gradient(900px 520px at 0% 0%, rgba(0, 141, 210, .10), transparent 60%),
              radial-gradient(800px 520px at 100% 100%, rgba(176, 203, 31, .14), transparent 60%), var(--ground); }

@media (max-width: 860px) {
  .shell { flex-direction: column; min-height: 0; }
  .side { width: auto; height: auto; position: static; flex-direction: row; overflow-x: auto; padding: 8px 10px; border-right: none; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side a { min-height: 40px; padding: 8px 12px; }
  .main { padding: 20px 16px 40px; gap: 18px; }
  h1 { font-size: 23px; }
}

/* Headers */
.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; }
.page-head .sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.hello { display: flex; align-items: center; gap: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--field); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--gray-tint); color: var(--ink); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #333; color: #fff; }
.btn-danger { color: var(--red-ink); border-color: #F3B9BB; }
.btn-danger:hover { background: var(--red-tint); color: var(--red-ink); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: none; padding: 0; font: inherit; font-size: 13px; font-weight: 500; color: var(--blue); cursor: pointer; text-decoration: none; }
.link-btn:hover { color: var(--blue-hover); text-decoration: underline; }
.link-btn.danger { color: var(--red-ink); }

/* Cards and grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 13px; color: var(--muted); }
.stat strong { font-family: "Space Grotesk", sans-serif; font-size: 26px; font-weight: 600; }
.stat strong small { font-size: 15px; font-weight: 500; color: var(--muted); font-family: Inter, sans-serif; }
.stat strong small.red { color: var(--red-ink); }
.section { display: flex; flex-direction: column; gap: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--ink); min-height: 168px; }
.tile:hover { border-color: #C9C9C2; color: var(--ink); }
.tile .top { display: flex; justify-content: space-between; align-items: center; }
.tile .name { font-size: 16px; font-weight: 600; }
.tile .desc { font-size: 13px; color: var(--muted); }
.tile .status { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-top: auto; }
.tile .status.red { color: var(--red-ink); } .tile .status.green { color: var(--green-ink); } .tile .status.blue { color: var(--blue-ink); }
.tile.add { border: 1.5px dashed #C9C9C2; background: transparent; align-items: center; justify-content: center; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.app-icon { width: 44px; height: 44px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.today { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tile { padding: 14px; min-height: 0; } .tile .desc { display: none; } }

/* Colours */
.c-blue { background: var(--blue-tint); color: var(--blue-ink); }
.c-green { background: var(--green-tint); color: var(--green-ink); }
.c-red { background: var(--red-tint); color: var(--red-ink); }
.c-orange { background: var(--orange-tint); color: var(--orange-ink); }
.c-gray { background: var(--gray-tint); color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* Lists */
.rows { display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.row:last-child { border-bottom: none; }
.row .left { display: flex; gap: 12px; align-items: center; min-width: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-logo); flex-shrink: 0; }
.empty { padding: 22px 18px; color: var(--muted); font-size: 14px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 34px; height: 34px; font-size: 12px; background: var(--gray-tint); color: var(--ink-2); }
.person small { display: block; font-size: 12px; color: var(--muted); }
.num { text-align: right; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 14px; font-weight: 500; }
.field .hint { font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=date], input[type=url], select, textarea {
  width: 100%; min-height: 46px; border: 1px solid var(--field); border-radius: var(--radius); padding: 10px 14px; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
}
textarea { min-height: 90px; resize: vertical; }
select { padding-right: 34px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%233F434B' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; }
.matrix select { min-height: 40px; font-size: 13px; width: 100%; min-width: 164px; letter-spacing: -0.01em; padding: 6px 24px 6px 9px; background-position: right 8px center; }
.matrix select.none { color: var(--muted); background-color: #FAFAF8; }
.matrix input[type=text] { min-height: 40px; font-size: 14px; font-weight: 500; width: 100%; min-width: 212px; padding-left: 10px; padding-right: 8px; }
.matrix th.tick, .matrix td.tick { text-align: center; width: 84px; white-space: normal; line-height: 1.3; }
.matrix td.tick .check { justify-content: center; }
.matrix td.num, .matrix th.num { width: 64px; }
.matrix td, .matrix th { padding-left: 8px; padding-right: 8px; }
.matrix td:first-child, .matrix th:first-child { padding-left: 14px; }
.main:has(.matrix) { max-width: 1480px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters input[type=search] { flex: 1 1 240px; width: auto; }
.filters select { width: auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { min-height: 42px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--field); background: var(--surface); color: var(--ink-2); font-size: 13px; display: inline-flex; align-items: center; text-decoration: none; }
.tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Messages */
.flash { padding: 12px 16px; border-radius: 12px; font-size: 14px; }
.flash-ok { background: var(--green-tint); color: var(--green-ink); }
.flash-error { background: var(--red-tint); color: var(--red-ink); }
.flash-info { background: var(--blue-tint); color: var(--blue-ink); }
.banner { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Auth pages: a centred white card on a soft brand-tinted background */
.auth { position: relative; width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 40px 36px 30px;
  box-shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 18px 48px -18px rgba(17, 17, 17, .18); overflow: hidden; }
.auth::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--blue-logo), var(--green)); }
.auth .logo { display: block; width: 200px; max-width: 70%; height: auto; margin: 0 auto 4px; }
.auth .auth-head { text-align: center; }
.auth h1 { font-size: 28px; letter-spacing: -.01em; }
.auth .auth-head p { margin-top: 6px; }
.auth .form { gap: 16px; }
.auth input[type=email], .auth input[type=password], .auth input[type=text], .auth input[type=tel], .auth select { background: #FBFBF9; transition: border-color .15s, box-shadow .15s, background .15s; }
.auth input:focus, .auth select:focus { background: #fff; border-color: var(--blue-logo); box-shadow: 0 0 0 3px rgba(0, 141, 210, .15); outline: none; }
.auth .btn-primary { min-height: 48px; font-size: 15px; font-weight: 600; margin-top: 4px; }
.auth .between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.auth .foot { font-size: 13px; color: var(--muted); text-align: center; padding-top: 18px; border-top: 1px solid var(--line-2); }
.auth .foot a { font-weight: 600; text-decoration: none; }
.auth .foot a:hover { text-decoration: underline; }
.auth-note { font-size: 12px; color: var(--muted); text-align: center; display: flex; align-items: center; gap: 6px; }
.auth-note svg { width: 14px; height: 14px; }
@media (max-width: 480px) {
  .auth { padding: 32px 22px 24px; border-radius: 16px; }
  .auth h1 { font-size: 25px; }
}

/* Apps page: QR code for phones */
.install { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.qrcol { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: 0 0 auto; }
.qr { background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--line); width: 200px; min-height: 200px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); text-align: center; }
.qr svg { display: block; width: 178px; height: 178px; }

/* Settings */
.brand-preview { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; align-items: center; justify-content: center; min-height: 120px; }
.brand-preview img { max-height: 110px; max-width: 100%; height: auto; }
.icon-preview { width: 96px; height: 96px; border-radius: 22px; border: 1px solid var(--line); background: #fff; }
.icon-preview.sm { width: 48px; height: 48px; border-radius: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; }
fieldset legend { font-size: 13px; font-weight: 600; padding: 0 6px; }
[hidden] { display: none !important; }

/* App access ticks (Users → edit person) */
.access-list { padding: 4px 0; }
.access-row { display: flex; gap: 14px 20px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.access-row:last-child { border-bottom: none; }
.access-app { width: 190px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; flex-shrink: 0; }
.access-app .exc { color: var(--orange-ink); background: var(--orange-tint); padding: 1px 8px; border-radius: 999px; font-size: 11px; }
.access-opts { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.access-opts .opt { position: relative; cursor: pointer; }
.access-opts .opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.access-opts .opt span { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px 6px 10px; border: 1px solid var(--field); border-radius: 999px; font-size: 13px; color: var(--ink-2); background: var(--surface); transition: background .12s, border-color .12s; }
.access-opts .opt span svg { width: 14px; height: 14px; opacity: 0; color: #fff; background: transparent; border: 1.5px solid var(--field); border-radius: 4px; padding: 1px; box-sizing: content-box; }
.access-opts .opt span svg { opacity: 1; stroke: transparent; }
.access-opts .opt:hover span { border-color: var(--ink-2); }
.access-opts .opt input:checked + span { background: var(--blue-tint); border-color: var(--blue); color: var(--ink); font-weight: 600; }
.access-opts .opt input:checked + span svg { background: var(--blue); border-color: var(--blue); stroke: #fff; }
.access-opts .opt input[value="__none__"]:checked + span { background: var(--gray-tint); border-color: var(--ink-2); }
.access-opts .opt input[value="__none__"]:checked + span svg { background: var(--ink-2); border-color: var(--ink-2); }
.access-opts .opt input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.access-opts .def { font-weight: 400; color: var(--muted); }
@media (max-width: 640px) { .access-app { width: 100%; flex-direction: row; align-items: center; } }

/* Upcoming holidays on Home */
.hol-date { width: 46px; height: 46px; border-radius: 12px; background: var(--green-tint); color: var(--green-ink); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; flex-shrink: 0; }
.hol-date b { font-size: 17px; font-family: "Space Grotesk", Inter, sans-serif; }
.hol-date small { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
