:root {
  color: #15233b;
  background: #f3f6fa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --navy-950: #07172f;
  --navy-900: #0b2142;
  --navy-800: #12315d;
  --blue: #2368e8;
  --teal: #12a99a;
  --coral: #ed5b5e;
  --muted: #68778d;
  --line: #dfe7f0;
}
* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; background: #f3f6fa; }
body.sidebar-open { overflow: hidden; }
a { color: inherit; }
.app-shell {
  min-height: 100vh;
  margin-left: 252px;
}
header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  padding: 10px 3vw;
  color: white;
  background: var(--navy-950);
  box-shadow: 0 5px 22px rgba(7, 23, 47, .17);
}
.header-start { display: none; align-items: center; gap: 10px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 1.13rem;
  font-weight: 850;
  letter-spacing: -.035em;
  text-decoration: none;
}
.brand strong { color: #60d7cb; }
.brand > span:last-child { display: grid; }
.brand small { color: #91a5be; font-size: .57rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--teal);
}
.brand-mark svg { width: 23px; fill: currentColor; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: 252px;
  flex-direction: column;
  overflow-y: auto;
  padding: 18px 14px;
  color: white;
  background: var(--navy-950);
  box-shadow: 8px 0 28px rgba(7, 23, 47, .16);
}
.sidebar > .brand { min-height: 48px; margin: 0 7px 17px; }
.sidebar-close, .menu-toggle, .sidebar-backdrop { display: none; }
select, input {
  min-height: 41px;
  padding: 8px 12px;
  border: 1px solid #cad6e4;
  border-radius: 9px;
  outline: none;
  color: #17243a;
  background: white;
  font: inherit;
  font-size: .82rem;
}
select:focus, input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(35, 104, 232, .12); }
header select { min-width: 170px; border-color: rgba(255,255,255,.2); color: white; background: rgba(255,255,255,.11); }
header select option { color: #17243a; background: white; }
button, .button {
  display: inline-flex;
  min-height: 41px;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 0;
  border-radius: 9px;
  color: white;
  background: var(--coral);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform .15s, background .15s;
}
button:hover, .button:hover { transform: translateY(-1px); background: #d8494d; }
button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
button.secondary, .button.secondary { color: var(--navy-900); background: #e8eef5; }
button.secondary:hover, .button.secondary:hover { background: #dbe5ef; }
.link-button { color: #c6d2e1; background: transparent; }
.link-button:hover { color: white; background: rgba(255,255,255,.1); }
nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,.1);
}
nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #b8c7d9;
  font-size: .78rem;
  font-weight: 750;
  text-decoration: none;
}
nav a:hover { color: white; background: rgba(255,255,255,.09); }
nav a.active { color: white; background: var(--blue); }
main { max-width: 1420px; margin: 0 auto; padding: 31px 3vw 70px; }
.page-title { display: flex; min-height: 69px; align-items: flex-start; justify-content: space-between; gap: 18px; }
h1, h2, h3 { color: var(--navy-900); line-height: 1.2; }
h1 { margin: 0; font-size: clamp(1.65rem, 2.7vw, 2.25rem); letter-spacing: -.04em; }
.page-title p { margin: 6px 0 0; color: var(--muted); font-size: .84rem; }
.status {
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
  color: #526176;
  background: #e4ebf3;
  font-size: .68rem;
  font-weight: 750;
}
.status.ok { color: #176c50; background: #dff5eb; }
.status.error { color: #9a3138; background: #fde5e7; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0 21px; }
.controls:empty { display: none; }
.controls input { min-width: min(320px, 100%); flex: 1; }
.content { display: grid; gap: 16px; }
.grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); }
#items:not(:has(> .card)) { grid-template-columns: 1fr; }
.card, .panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 2px 7px rgba(18, 32, 57, .035);
}
.card h2, .card h3, .card p, .panel h2, .panel h3, .panel p { margin-top: 0; }
.card h2 { font-size: 1.14rem; }
.card h3 { overflow-wrap: anywhere; font-size: .98rem; }
.muted { color: var(--muted); }
.small { font-size: .74rem; }
.overline { display: block; margin-bottom: 5px; color: var(--teal); font-size: .61rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; width: max-content; padding: 4px 8px; border-radius: 999px; color: #4d6079; background: #edf2f7; font-size: .65rem; font-weight: 700; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.empty, .notice {
  padding: 25px;
  border: 1px solid #b9d8ff;
  border-radius: 14px;
  color: #234c80;
  background: #eef6ff;
}
.empty strong { color: var(--navy-900); }
.empty p { margin-bottom: 0; }
.warning { border-color: #f2d08a; color: #7d5615; background: #fff9eb; }
.danger { border-color: #f2b9bc; color: #96353a; background: #fff0f1; }
.load-more { justify-self: center; margin: 6px; }
.frame {
  display: flex;
  min-height: 500px;
  align-items: center;
  justify-content: center;
  padding: 15px;
  overflow: hidden;
  border-radius: 15px;
  background: var(--navy-950);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.frame img { max-width: 100%; max-height: 75vh; object-fit: contain; }
.timeline { display: grid; gap: 7px; }
.timeline-row { display: grid; grid-template-columns: 185px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #edf1f5; font-size: .76rem; }
.timeline-row:last-child { border: 0; }
.timeline-row a { color: var(--blue); font-weight: 750; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 10px; }
.metric { padding: 14px; border: 1px solid #e5ebf2; border-radius: 10px; color: var(--muted); background: #f7f9fc; font-size: .72rem; }
.metric strong { display: block; margin-top: 5px; color: var(--navy-900); font-size: .96rem; overflow-wrap: anywhere; }

.dashboard-hero {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 25px;
  padding: 25px 28px;
  border-radius: 17px;
  color: white;
  background: radial-gradient(circle at 80% 10%, rgba(18,169,154,.26), transparent 28%), linear-gradient(135deg, var(--navy-950), var(--navy-800));
  box-shadow: 0 17px 40px rgba(7, 23, 47, .18);
}
.dashboard-hero h2 { margin: 0 0 5px; color: white; font-size: 1.65rem; }
.dashboard-hero p { margin: 0; color: #aebed1; font-size: .77rem; }
.dashboard-hero .overline { color: #63dbd0; }
.dashboard-hero .button.secondary { color: white; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); }
.device-presence { display: flex; align-items: center; gap: 10px; }
.device-presence i { width: 10px; height: 10px; border-radius: 50%; background: #f0a6aa; box-shadow: 0 0 0 5px rgba(237,91,94,.14); }
.device-presence.is-online i { background: #49d79f; box-shadow: 0 0 0 5px rgba(73,215,159,.14); }
.device-presence div { display: grid; }
.device-presence strong { font-size: .78rem; }
.device-presence span { color: #9eb0c5; font-size: .62rem; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 11px; }
.dashboard-metrics a {
  display: grid;
  min-height: 126px;
  align-content: space-between;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.dashboard-metrics a:hover { transform: translateY(-2px); box-shadow: 0 12px 25px rgba(18,32,57,.08); }
.dashboard-metrics span { color: var(--muted); font-size: .68rem; font-weight: 700; }
.dashboard-metrics strong { color: var(--navy-900); font-size: 1.12rem; overflow-wrap: anywhere; }
.dashboard-metrics small { color: #96a2b2; font-size: .61rem; }
.dashboard-columns { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.panel-head h2 { margin: 0; font-size: 1.12rem; }
.panel-head > a { color: var(--blue); font-size: .7rem; font-weight: 800; text-decoration: none; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.quick-grid a { display: grid; padding: 13px; border: 1px solid #e5ebf2; border-radius: 10px; text-decoration: none; }
.quick-grid a:hover { border-color: #b8cdeb; background: #f6f9fd; }
.quick-grid b { color: var(--navy-900); font-size: .75rem; }
.quick-grid span { color: var(--muted); font-size: .64rem; }
.compact-list { display: grid; }
.compact-list > div { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid #edf1f5; }
.compact-list > div:first-child { border: 0; }
.compact-list i { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); }
.compact-list i.urgent { background: var(--coral); }
.compact-list p { display: grid; margin: 0; }
.compact-list strong { font-size: .72rem; }
.compact-list span, .compact-list time { color: var(--muted); font-size: .61rem; }
.compact-list time { max-width: 105px; text-align: right; }
.transparency-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 25px 28px;
  border: 1px solid #cfe7e4;
  border-radius: 15px;
  background: linear-gradient(135deg, #edf9f7, #f3f7fd);
}
.transparency-banner h2 { margin: 0 0 5px; font-size: 1.05rem; }
.transparency-banner p { max-width: 850px; margin: 0; color: var(--muted); font-size: .74rem; }
.plan-summary { padding: 28px; border-radius: 17px; color: white; background: linear-gradient(135deg, var(--navy-950), var(--navy-800)); }
.plan-summary h2 { margin: 0 0 6px; color: white; font-size: 1.6rem; }
.plan-summary p { margin: 0; color: #b8c7d9; }
.plan-summary .overline { color: #63dbd0; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.plan-card { display: grid; align-content: start; padding: 26px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.plan-card.featured { color: white; border-color: #32588d; background: linear-gradient(145deg, var(--navy-900), var(--navy-800)); }
.plan-card h2 { margin: 0 0 7px; }
.plan-card.featured h2, .plan-card.featured .plan-price { color: white; }
.plan-card.featured .overline { color: #63dbd0; }
.plan-price { color: var(--navy-900); font-size: 2rem; }
.plan-price small { font-size: .7rem; font-weight: 650; }
.plan-card ul { display: grid; gap: 9px; min-height: 130px; margin: 20px 0; padding: 0; list-style: none; }
.plan-card li { position: relative; padding-left: 20px; font-size: .74rem; }
.plan-card li::before { position: absolute; left: 0; content: "✓"; color: var(--teal); font-weight: 900; }
.plan-card.featured li { color: #d8e2ee; }
.plan-card button { align-self: end; }
.welcome-panel { display: grid; grid-template-columns: 1fr .75fr; gap: 35px; padding: 38px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.welcome-panel h2 { margin-bottom: 12px; font-size: 1.7rem; }
.welcome-panel p { max-width: 650px; color: var(--muted); }
.setup-list { display: grid; gap: 9px; }
.setup-list span { display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 10px; color: #4e5f76; background: #f3f6fa; font-size: .73rem; font-weight: 700; }
.setup-list b { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 8px; color: white; background: var(--teal); }

.activity-row, .record-row, .message-row, .usage-row, .notification-row {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.activity-row { display: grid; grid-template-columns: 82px 1fr 155px; align-items: center; gap: 15px; }
.activity-row h3, .activity-row p { margin: 0; }
.activity-row h3 { font-size: .78rem; }
.activity-row p { margin-top: 3px; color: var(--muted); font-size: .68rem; overflow-wrap: anywhere; }
.activity-row time, .notification-row time { color: #8290a3; font-size: .64rem; text-align: right; }
.activity-type { display: inline-flex; width: max-content; padding: 5px 8px; border-radius: 999px; color: #155f59; background: #def6f2; font-size: .62rem; font-weight: 850; }
.type-alerts { color: #9b353b; background: #fde7e8; }
.type-calls, .type-sms { color: #235ca9; background: #e4efff; }
.type-social { color: #6645ad; background: #eee8fb; }
.type-location { color: #8a5919; background: #fff0d9; }
.record-row { display: grid; grid-template-columns: auto 1fr auto 145px; align-items: center; gap: 13px; }
.record-avatar { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg, var(--navy-800), var(--blue)); font-size: .85rem; font-weight: 850; }
.record-row h3, .record-row p, .record-meta strong, .record-meta time { margin: 0; }
.record-row h3 { font-size: .78rem; }
.record-row p { color: var(--muted); font-size: .66rem; }
.record-meta { display: grid; text-align: right; }
.record-meta strong { font-size: .71rem; }
.record-meta time { color: var(--muted); font-size: .61rem; }
.message-row { display: grid; gap: 8px; }
.message-head { display: grid; grid-template-columns: 1fr auto 165px; align-items: center; gap: 10px; }
.message-head h3, .message-row p { margin: 0; }
.message-head h3 { font-size: .78rem; }
.message-head time { color: var(--muted); font-size: .62rem; text-align: right; }
.message-row p { color: #46566d; font-size: .72rem; overflow-wrap: anywhere; }
.usage-row { display: grid; grid-template-columns: minmax(190px, .7fr) 1fr 70px; align-items: center; gap: 17px; }
.usage-row h3, .usage-row p { margin: 0; }
.usage-row h3 { font-size: .75rem; }
.usage-row p { color: var(--muted); font-size: .61rem; }
.usage-bar { height: 8px; overflow: hidden; border-radius: 999px; background: #e8eef5; }
.usage-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--blue)); }
.usage-row strong { color: var(--navy-900); font-size: .72rem; text-align: right; }
.notification-row { display: grid; grid-template-columns: auto 1fr 155px; align-items: center; gap: 13px; }
.notification-row h3, .notification-row p { margin: 0; }
.notification-row h3 { font-size: .77rem; }
.notification-row p { margin-top: 3px; color: var(--muted); font-size: .68rem; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 23, 47, .82);
}
.hidden { display: none; }
.modal-card {
  position: relative;
  width: min(1000px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 48px 16px 16px;
  border-radius: 14px;
  background: white;
}
.modal-close { position: absolute; top: 8px; right: 8px; }
.modal-card img, .modal-card video, .modal-card audio, .modal-card iframe { display: block; width: 100%; max-height: 78vh; object-fit: contain; }
.progress { color: var(--blue); font-weight: 800; }

@media (max-width: 1180px) {
  .dashboard-metrics { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
  .app-shell { margin-left: 0; }
  .sidebar {
    width: min(300px, 86vw);
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close {
    position: absolute;
    top: 18px;
    right: 13px;
    display: inline-grid;
    width: 39px;
    min-height: 39px;
    place-items: center;
    padding: 0;
    color: white;
    background: rgba(255,255,255,.1);
    font-size: 1.35rem;
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    width: 100%;
    min-height: 100%;
    padding: 0;
    border-radius: 0;
    background: rgba(7, 23, 47, .58);
  }
  .sidebar-backdrop:hover { transform: none; background: rgba(7, 23, 47, .58); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  header { align-items: stretch; flex-direction: column; padding: 11px 14px; }
  .header-start { display: flex; justify-content: space-between; }
  .mobile-brand { font-size: 1rem; }
  .mobile-brand .brand-mark { width: 35px; height: 35px; }
  .menu-toggle {
    display: inline-flex;
    min-height: 39px;
    padding: 8px 12px;
    color: white;
    background: rgba(255,255,255,.1);
  }
  .menu-toggle:hover { background: rgba(255,255,255,.17); }
  .header-actions { flex-wrap: wrap; }
  .header-actions select { min-width: 0; flex: 1; }
  main { padding: 23px 14px 55px; }
  .page-title { flex-direction: column; }
  .dashboard-hero { grid-template-columns: 1fr; }
  .dashboard-metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-columns, .welcome-panel { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .transparency-banner { align-items: stretch; flex-direction: column; }
  .timeline-row { grid-template-columns: 1fr; }
  .activity-row { grid-template-columns: 1fr; }
  .activity-row time { text-align: left; }
  .record-row { grid-template-columns: auto 1fr; }
  .record-row > .chip, .record-meta { grid-column: 2; text-align: left; }
  .message-head { grid-template-columns: 1fr auto; }
  .message-head time { grid-column: 1 / -1; text-align: left; }
  .usage-row { grid-template-columns: 1fr 65px; }
  .usage-bar { grid-column: 1 / -1; grid-row: 2; }
  .notification-row { grid-template-columns: auto 1fr; }
  .notification-row time { grid-column: 2; text-align: left; }
}
@media (max-width: 480px) {
  .dashboard-metrics { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .controls > * { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
