/* CloudyIT Support Portal — app styling. Built on colors_and_type.css tokens. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg-canvas); color: var(--fg-body); }
#root { min-height: 100vh; }

button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ---------- shared ---------- */
.cy-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--cloudy-blue); margin: 0;
}
.cy-eyebrow::before { content: ""; width: 7px; height: 7px; background: currentColor; display: inline-block; }
.cy-eyebrow.sky { color: var(--cloudy-sky); }
.cy-eyebrow.slate { color: var(--slate); }

.cy-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 600; letter-spacing: -0.005em;
  padding: 11px 18px; border-radius: var(--r-md); border: 1px solid transparent;
  cursor: pointer; transition: background .15s, color .15s, transform .1s, box-shadow .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cloudy-blue); color: #fff; }
.btn-primary:hover { background: #0078AD; }
.btn-navy { background: var(--cloudy-navy); color: #fff; }
.btn-navy:hover { background: #081C30; }
.btn-outline { background: #fff; color: var(--cloudy-navy); border-color: var(--cloudy-navy); }
.btn-outline:hover { background: var(--canvas); }
.btn-ghost { background: transparent; color: var(--cloudy-blue); padding: 11px 8px; }
.btn-ghost:hover { color: #0078AD; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- inputs ---------- */
.field-label { font-size: 12px; font-weight: 600; color: var(--cloudy-navy); margin-bottom: 6px; display: block; }
.input, .textarea, .select {
  width: 100%; font-size: 14px; padding: 11px 14px; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; outline: none;
  transition: box-shadow .15s, border-color .15s;
}
.input:focus, .textarea:focus, .select:focus { box-shadow: var(--shadow-focus); border-color: var(--cloudy-blue); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.select { appearance: none; padding-right: 38px;
  background-image: linear-gradient(45deg,transparent 50%,#6B7280 50%),linear-gradient(135deg,#6B7280 50%,transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--r-pill); line-height: 1.5; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.badge-success { background: rgba(16,185,129,.12); color: #0f8a63; }
.badge-warning { background: rgba(245,158,11,.15); color: #b9760a; }
.badge-error   { background: rgba(220,38,38,.10);  color: #c42121; }
.badge-info    { background: rgba(0,142,202,.12);  color: #0078AD; }
.badge-neutral { background: #EEF2F7; color: var(--slate); }

/* ---------- tables ---------- */
.cy-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cy-table thead th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--slate); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.cy-table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; }
.cy-table tbody tr:last-child td { border-bottom: 0; }
.cy-table tbody tr { transition: background .12s; }
.cy-table.rows-hover tbody tr:hover { background: var(--canvas); cursor: pointer; }

/* ---------- progress ---------- */
.bar { height: 8px; border-radius: 999px; background: #EEF2F7; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--cloudy-blue); transition: width .6s cubic-bezier(.2,.6,.2,1); }

/* ---------- layout shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--cloudy-navy); color: #fff; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 22px 16px;
}
.side-org {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md);
  background: rgba(255,255,255,.06); margin-bottom: 22px;
}
.side-org .avatar { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--cloudy-blue);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; flex: none; }
.nav-section { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,.4);
  padding: 0 12px; margin: 18px 0 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 12px; border-radius: var(--r-md); border: 0; background: transparent;
  color: rgba(255,255,255,.72); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background .12s, color .12s; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(0,142,202,.18); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 999px; background: var(--cloudy-sky); }
.nav-item .count { margin-left: auto; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.12);
  padding: 1px 8px; border-radius: 999px; }
.nav-item.active .count { background: var(--cloudy-blue); }

.topbar {
  position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px;
  padding: 0 28px; height: 64px;
}
.search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px;
  background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 14px;
  color: var(--slate); font-size: 14px;
}
.search input { border: 0; background: transparent; outline: none; flex: 1; color: var(--ink); font-size: 14px; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--slate); position: relative;
  transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--canvas); color: var(--cloudy-navy); }
.icon-btn .ping { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 999px;
  background: var(--error); border: 2px solid #fff; }

.content { padding: 32px 40px 64px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 32px; margin: 8px 0 0; }
.page-sub { color: var(--slate); margin: 6px 0 0; font-size: 15px; }

.grid { display: grid; gap: 20px; }
.stat-cards { grid-template-columns: repeat(4, 1fr); }
.kpi { padding: 20px 22px; }
.kpi .k-icon { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; margin-bottom: 14px; }
.kpi .k-val { font-size: 30px; font-weight: 800; color: var(--cloudy-navy); letter-spacing: -0.02em; line-height: 1; }
.kpi .k-label { color: var(--slate); font-size: 13px; margin-top: 6px; }

/* ---------- status timeline ---------- */
.timeline { display: flex; align-items: flex-start; gap: 0; }
.tl-step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; }
.tl-step .node { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--line); color: var(--slate); z-index: 1; transition: all .3s; }
.tl-step.done .node { background: var(--success); border-color: var(--success); color: #fff; }
.tl-step.current .node { background: var(--cloudy-blue); border-color: var(--cloudy-blue); color: #fff;
  box-shadow: 0 0 0 5px rgba(0,142,202,.16); }
.tl-step .lbl { font-size: 12.5px; font-weight: 600; margin-top: 10px; color: var(--cloudy-navy); }
.tl-step.pending .lbl { color: var(--slate); font-weight: 500; }
.tl-step .time { font-size: 11px; color: var(--slate); margin-top: 2px; }
.tl-line { position: absolute; top: 16px; left: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.tl-step.done .tl-line { background: var(--success); }

/* ---------- modal / drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10,37,64,.45); display: grid; z-index: 50;
  animation: fade .15s ease; }
.modal { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: min(640px, calc(100% - 40px)); margin: auto; max-height: 90vh; overflow: auto; animation: pop .2s cubic-bezier(.2,.6,.2,1); }
.drawer-wrap { position: fixed; inset: 0; z-index: 50; }
.drawer { position: absolute; top: 0; right: 0; height: 100%; width: min(560px, 100%); background: #fff;
  box-shadow: var(--shadow-lg); overflow: auto; animation: slidein .25s cubic-bezier(.2,.6,.2,1); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
@keyframes slidein { from { transform: translateX(100%); } }

.appear { animation: appear .4s cubic-bezier(.2,.6,.2,1) both; }
@keyframes appear { from { opacity: 0; transform: translateY(8px); } }

/* ---------- prototype banner ---------- */
.proto-banner {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  background: var(--cloudy-navy); color: #fff; padding: 9px 20px;
  font-size: 13px; line-height: 1.3; position: relative; z-index: 60;
}
.proto-banner .tag {
  display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--cloudy-navy);
  background: var(--warning); padding: 3px 10px; border-radius: var(--r-pill); flex: none;
}
.proto-banner .txt { color: rgba(255,255,255,.88); }
.proto-banner .txt b { color: #fff; font-weight: 600; }
.proto-banner .dismiss { position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: rgba(255,255,255,.55); cursor: pointer; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: var(--r-sm); }
.proto-banner .dismiss:hover { color: #fff; background: rgba(255,255,255,.1); }
@media (max-width: 640px) { .proto-banner .txt { display: none; } }
body.has-banner .sidebar { height: calc(100vh - 38px); }

.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-chip { flex: 1; min-width: 90px; text-align: center; padding: 10px; border: 1px solid var(--line);
  border-radius: var(--r-md); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--slate);
  background: #fff; transition: all .12s; }
.radio-chip:hover { border-color: var(--border-strong); }
.radio-chip.sel { border-color: var(--cloudy-blue); background: rgba(0,142,202,.06); color: var(--cloudy-navy);
  box-shadow: inset 0 0 0 1px var(--cloudy-blue); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 24px 20px 48px; }
}
