/* ============================================================
   OTT24X7 License Panel — Hybrid design system
   • Skeuomorphism  → buttons, toggles, sliders (tactile, glossy)
   • Neumorphism    → cards, containers, inputs (soft extruded)
   • Glassmorphism  → sidebar, toolbars, headers, modals, toasts
   ============================================================ */
:root {
  /* base neumorphic surface (main area == body so extrusion reads) */
  --surface: #1c212b;
  --surface-2: #191e27;
  --nm-dark: #0e1116;         /* bottom-right shadow */
  --nm-light: #2a3241;        /* top-left highlight */

  --text: #e9eef5;
  --muted: #98a6b6;
  --muted-2: #667283;

  --red: #e50914;
  --red-lo: #ff3b42;
  --red-hi: #c00610;
  --green: #2ecc71;
  --amber: #f5a623;
  --blue: #4c8dff;
  --purple: #a78bfa;

  /* glass tokens */
  --glass-bg: rgba(28, 34, 46, 0.55);
  --glass-bg-strong: rgba(26, 32, 44, 0.72);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-hi: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(20px) saturate(150%);

  --radius: 16px;
  --radius-sm: 11px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  /* reusable shadow recipes */
  --nm-raised: 6px 6px 14px var(--nm-dark), -6px -6px 14px var(--nm-light);
  --nm-raised-sm: 4px 4px 9px var(--nm-dark), -4px -4px 9px var(--nm-light);
  --nm-inset: inset 4px 4px 8px var(--nm-dark), inset -3px -3px 7px var(--nm-light);
  --glass-shadow: 0 12px 40px rgba(0,0,0,0.45), inset 0 1px 0 var(--glass-hi);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  position: relative;
  overflow-x: hidden;
}
/* ambient colour field so glass layers have something to refract */
body::before {
  content: "";
  position: fixed; inset: -20%;
  z-index: -1;
  background:
    radial-gradient(42vw 42vw at 82% -8%, rgba(229,9,20,0.16), transparent 60%),
    radial-gradient(40vw 40vw at -6% 12%, rgba(76,141,255,0.12), transparent 62%),
    radial-gradient(46vw 46vw at 60% 108%, rgba(167,139,250,0.13), transparent 60%);
  filter: saturate(120%);
  pointer-events: none;
}
a { color: var(--purple); text-decoration: none; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #303a48, #202732);
  border-radius: 8px; border: 2px solid var(--surface);
}
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   NEUMORPHISM — inputs
   ============================================================ */
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 8px; letter-spacing: .25px; }
.field { margin-bottom: 18px; }

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px; font-family: inherit;
  outline: none;
  box-shadow: var(--nm-inset);
  transition: box-shadow .2s, color .2s;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
  box-shadow: var(--nm-inset), 0 0 0 2px rgba(229,9,20,0.35);
}
input[readonly] { color: var(--muted); }
select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2398a6b6' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px;
}
input[type=file] { padding: 9px 12px; font-size: 12.5px; color: var(--muted); }
input[type=file]::-webkit-file-upload-button {
  border: none; margin-right: 12px; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  color: #fff; font-weight: 600; font-family: inherit;
  background: linear-gradient(180deg, #3a4453, #232a34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 2px 4px rgba(0,0,0,.4);
}

/* ============================================================
   SKEUOMORPHISM — buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 11px;
  font-weight: 700; font-size: 13.5px; font-family: inherit;
  cursor: pointer; color: var(--text);
  border: 1px solid rgba(0,0,0,0.55);
  text-shadow: 0 -1px 0 rgba(0,0,0,0.35);
  background: linear-gradient(180deg, #333d4c 0%, #232b36 52%, #1c232d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 -6px 12px rgba(0,0,0,0.28),
    0 6px 12px rgba(0,0,0,0.42),
    0 1px 2px rgba(0,0,0,0.6);
  transition: transform .06s ease, box-shadow .1s ease, filter .12s;
}
.btn::before { /* glossy top sheen */
  content: ""; position: absolute;
}
.btn:hover { filter: brightness(1.08); }
.btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 1px 2px rgba(0,0,0,0.5);
}
.btn-primary {
  color: #fff; border-color: #6a0308;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.45);
  background: linear-gradient(180deg, #ff4750 0%, #e50914 48%, #b3060e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -7px 14px rgba(120,0,4,0.5),
    0 6px 16px rgba(229,9,20,0.4),
    0 1px 2px rgba(0,0,0,0.5);
}
.btn-primary:active {
  box-shadow:
    inset 0 3px 7px rgba(120,0,4,0.6),
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 1px 3px rgba(0,0,0,0.5);
}
.btn-primary:disabled {
  background: linear-gradient(180deg, #7a2a2e, #5c1c20);
  color: #d7b4b6; border-color: #3a1416; cursor: not-allowed; filter: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 2px 5px rgba(0,0,0,0.4);
}
.btn-ghost { /* subtle metallic */ }
.btn-danger {
  color: #ff8a8f; border-color: #4a1e21;
  background: linear-gradient(180deg, #34262a 0%, #241a1d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 4px 10px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.6);
}
.btn-danger:hover { color: #ff6b6b; filter: brightness(1.12); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ============================================================
   SKEUOMORPHISM — toggle switch
   ============================================================ */
.switch { position: relative; display: inline-block; width: 60px; height: 32px; cursor: pointer; vertical-align: middle; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 20px;
  background: linear-gradient(180deg, #0f1319, #1a2029);
  box-shadow:
    inset 2px 3px 6px rgba(0,0,0,0.75),
    inset -2px -2px 5px rgba(255,255,255,0.05),
    0 1px 0 rgba(255,255,255,0.05);
  transition: background .28s ease, box-shadow .28s ease;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #454f5d, #262d38 70%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.35),
    inset 0 -2px 3px rgba(0,0,0,0.4),
    0 3px 5px rgba(0,0,0,0.6);
  transition: transform .28s cubic-bezier(.3,1.4,.5,1), background .28s;
}
.switch input:checked + .track {
  background: linear-gradient(180deg, #33e07f, #1c8a4b);
  box-shadow: inset 2px 3px 6px rgba(0,0,0,0.35), 0 0 12px rgba(46,204,113,0.45);
}
.switch input:checked + .track .knob {
  transform: translateX(28px);
  background: radial-gradient(circle at 34% 28%, #ffffff, #d7dee6 72%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.9), 0 3px 6px rgba(0,0,0,0.5);
}
.switch-row { display: flex; align-items: center; gap: 14px; }
.switch-row .switch-label { font-weight: 600; color: var(--text); font-size: 13.5px; }

/* ============================================================
   SKEUOMORPHISM — range slider
   ============================================================ */
.slider { display: flex; align-items: center; gap: 14px; }
.slider input[type=range] { flex: 1; }
.slider-val {
  min-width: 44px; text-align: center; padding: 7px 10px; border-radius: 9px;
  font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text);
  background: var(--surface-2); box-shadow: var(--nm-inset);
}
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; background: transparent; box-shadow: none; padding: 0; cursor: pointer;
}
input[type=range]:focus { box-shadow: none; }
input[type=range]::-webkit-slider-runnable-track {
  height: 12px; border-radius: 8px;
  background: linear-gradient(180deg, #0f1319, #1b212b);
  box-shadow: inset 2px 3px 6px rgba(0,0,0,0.75), inset -1px -1px 3px rgba(255,255,255,0.05);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; margin-top: -7px; border-radius: 50%;
  border: 1px solid #0c0f14;
  background: radial-gradient(circle at 35% 28%, #ff5760 0%, #e50914 55%, #a30810 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.5),
    inset 0 -3px 5px rgba(120,0,4,0.5),
    0 3px 6px rgba(0,0,0,0.6);
  transition: filter .1s;
}
input[type=range]::-webkit-slider-thumb:active { filter: brightness(1.15); }
input[type=range]::-moz-range-track {
  height: 12px; border-radius: 8px;
  background: #12161c; box-shadow: inset 2px 3px 6px rgba(0,0,0,0.75);
}
input[type=range]::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid #0c0f14;
  background: radial-gradient(circle at 35% 28%, #ff5760, #e50914 55%, #a30810);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.5), 0 3px 6px rgba(0,0,0,0.6);
}

/* ============================================================
   GLASSMORPHISM — login
   ============================================================ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { /* neumorphic container */
  width: 100%; max-width: 390px;
  background: var(--surface);
  border-radius: 22px; padding: 42px 36px;
  box-shadow: var(--nm-raised);
}
.login-card .brand { display: flex; align-items: center; gap: 13px; margin-bottom: 8px; }
.mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 17px;
  background: linear-gradient(180deg, #ff4750, #b3060e);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), inset 0 -4px 8px rgba(120,0,4,0.5), 0 5px 12px rgba(229,9,20,0.45);
  text-shadow: 0 -1px 0 rgba(0,0,0,0.4);
}
.login-card h1 { font-size: 21px; margin: 0; letter-spacing: -.3px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin: 8px 0 30px; }
.err { color: #ff7b7b; font-size: 13px; margin-top: 14px; min-height: 18px; }
.hint { color: var(--muted-2); font-size: 12px; margin-top: 8px; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

/* GLASS — side panel */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 5px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  box-shadow: inset -1px 0 0 var(--glass-hi), 8px 0 32px rgba(0,0,0,0.35);
}
.sidebar .logo { display: flex; align-items: center; gap: 12px; padding: 6px 10px 24px; }
.sidebar .logo .mark { width: 36px; height: 36px; border-radius: 10px; font-size: 15px; }
.sidebar .logo .name { font-weight: 700; font-size: 15px; letter-spacing: -.2px; }
.sidebar .logo .role { font-size: 11px; color: var(--muted); }

.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 11px;
  color: var(--muted); font-weight: 600; cursor: pointer; font-size: 13.5px;
  transition: background .14s, color .14s, box-shadow .14s;
}
.nav-item svg { width: 18px; height: 18px; opacity: .9; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-item.active { /* skeuomorphic pressed pill inside the glass */
  color: #fff;
  background: linear-gradient(180deg, rgba(229,9,20,0.34), rgba(229,9,20,0.16));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -3px 8px rgba(120,0,4,0.35),
    0 2px 6px rgba(0,0,0,0.35);
  text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}
.nav-item.active svg { color: #fff; }
.sidebar .spacer { flex: 1; }
.sidebar .foot { border-top: 1px solid var(--glass-border); padding-top: 12px; margin-top: 6px; }

.main { padding: 26px 30px 70px; max-width: 1200px; width: 100%; }

/* GLASS — page header */
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-bottom: 24px; padding: 18px 22px; border-radius: var(--radius);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.page-head h2 { margin: 0; font-size: 21px; letter-spacing: -.4px; }
.page-head .desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.head-actions { display: flex; gap: 10px; align-items: center; }

/* ============================================================
   NEUMORPHISM — stat cards & containers
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat {
  background: var(--surface); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--nm-raised); position: relative;
}
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat .value { font-size: 32px; font-weight: 800; margin-top: 10px; letter-spacing: -1px; }
.stat.accent-red .value { color: #ff5964; }
.stat.accent-green .value { color: var(--green); }
.stat.accent-amber .value { color: var(--amber); }
.stat.accent-blue .value { color: var(--blue); }

.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--nm-raised); margin-bottom: 22px; overflow: hidden;
}
.card-head {
  padding: 16px 20px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.card-head h3 { margin: 0; font-size: 15px; }
.card-body { padding: 6px 4px; }

/* GLASS — toolbar */
.toolbar {
  display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.toolbar .grow { flex: 1; min-width: 170px; }
.toolbar input, .toolbar select { padding: 10px 13px; }

/* ============================================================
   TABLE
   ============================================================ */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 13px 18px; color: var(--muted); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .6px; border-bottom: 1px solid rgba(255,255,255,0.06); white-space: nowrap;
}
tbody td { padding: 13px 18px; border-bottom: 1px solid rgba(255,255,255,0.035); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child td { border-bottom: none; }
.mono { font-family: 'SF Mono', ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12.5px; }
.key-cell { font-weight: 600; letter-spacing: .3px; }
.copy { cursor: pointer; color: var(--muted-2); margin-left: 8px; font-size: 11px; }
.copy:hover { color: var(--purple); }
.row-actions { display: flex; gap: 7px; justify-content: flex-end; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }

/* ============================================================
   BADGES  (soft glass pills)
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .2px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.badge.active { background: rgba(46,204,113,0.14); color: #4fd98a; }
.badge.active .dot { background: #2ecc71; }
.badge.revoked { background: rgba(229,9,20,0.16); color: #ff7b7b; }
.badge.revoked .dot { background: var(--red); }
.badge.suspended { background: rgba(245,166,35,0.16); color: #f5b84f; }
.badge.suspended .dot { background: var(--amber); }
.badge.expired { background: rgba(120,130,145,0.18); color: #9aa7b5; }
.badge.expired .dot { background: #7a8797; }
.badge.plain { background: rgba(255,255,255,0.05); color: var(--muted); }

/* ============================================================
   GLASSMORPHISM — modal
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(6,9,14,0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px;
}
.modal {
  width: 100%; max-width: 510px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.14);
  animation: pop .18s ease;
}
.modal.wide { max-width: 640px; }
@keyframes pop { from { transform: translateY(-10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  padding: 19px 24px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--glass-border);
}
.modal-head h3 { margin: 0; font-size: 16.5px; }
.modal-head .x { cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; }
.modal-head .x:hover { color: var(--text); }
.modal-body { padding: 24px; max-height: 66vh; overflow-y: auto; }
/* inputs inside glass modal keep neumorphism but on a darker translucent base */
.modal-body input, .modal-body select, .modal-body textarea { background: rgba(15,19,25,0.72); }
.modal-foot {
  padding: 17px 24px; display: flex; justify-content: flex-end; gap: 11px;
  border-top: 1px solid var(--glass-border);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }

.gen-result {
  background: var(--surface-2); border-radius: 12px; padding: 15px; margin-top: 10px;
  box-shadow: var(--nm-inset);
}
.gen-result .k {
  font-family: ui-monospace, monospace; padding: 8px 0; display: flex; justify-content: space-between;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.gen-result .k:last-child { border-bottom: none; }

/* ============================================================
   GLASSMORPHISM — toast
   ============================================================ */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 11px; z-index: 90; }
.toast {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-left: 3px solid var(--green);
  padding: 13px 17px; border-radius: 12px; font-size: 13px; min-width: 230px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: slidein .22s ease;
}
.toast.error { border-left-color: var(--red); }
@keyframes slidein { from { transform: translateX(22px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============================================================
   RESELLER CARDS (neumorphic)
   ============================================================ */
.reseller-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.rcard { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--nm-raised); }
.rcard .top { display: flex; align-items: center; gap: 13px; }
.rcard .logo-box {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; overflow: hidden;
  background: var(--surface-2); box-shadow: var(--nm-inset);
}
.rcard .logo-box img { width: 100%; height: 100%; object-fit: cover; }
.rcard .logo-box span { font-weight: 800; color: var(--purple); }
.rcard .pfx {
  font-family: ui-monospace, monospace; padding: 3px 9px; border-radius: 7px; font-size: 12px; color: var(--muted);
  background: var(--surface-2); box-shadow: var(--nm-inset);
}
.rcard .metrics { display: flex; gap: 20px; margin: 18px 0; }
.rcard .metrics .m .n { font-size: 21px; font-weight: 800; }
.rcard .metrics .m .l { font-size: 11px; color: var(--muted); }
.rcard .acts { display: flex; gap: 8px; }

.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
