/* Touch Therapies CMS — Ocean Serenity admin theme */
:root {
  --turquoise: #0891b2;
  --turquoise-light: #22d3ee;
  --ocean: #164e63;
  --ocean-deep: #0d3742;
  --cream: #fbfaf7;
  --mist: #eef7f9;
  --ink: #1e3a44;
  --muted: #5b7482;
  --coral: #ef5844;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font: 15px/1.6 'Inter', system-ui, sans-serif;
  background: var(--mist);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--turquoise); text-decoration: none; }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--ocean-deep);
  color: #cde8ef;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; }
.brand em { color: var(--turquoise-light); font-style: italic; }
.brand span {
  display: block; font-size: 0.65rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: #7fb4c4; margin-top: 2px;
}
.sidebar nav { display: grid; gap: 2px; flex: 1; }
.sidebar nav a {
  color: #cde8ef; padding: 9px 12px; border-radius: 10px; font-size: 0.9rem;
  transition: background 0.2s;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.08); }
.sidebar nav a.on { background: var(--turquoise); color: #fff; }
.logout { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.82rem; }
.logout button {
  background: none; border: 1px solid rgba(255, 255, 255, 0.3); color: #cde8ef;
  border-radius: 8px; padding: 5px 10px; cursor: pointer;
}
.logout button:hover { background: var(--coral); border-color: var(--coral); }

.content { padding: 32px 36px; max-width: 1200px; }

.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 1.5rem; color: var(--ocean); }
.page-head p { color: var(--muted); font-size: 0.9rem; }
.page-head.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 0.9rem; font-weight: 500; }
.flash.ok { background: #d9f2ee; color: #0c5c50; }
.flash.err { background: #fde5e1; color: #a2372a; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 18px;
  box-shadow: 0 6px 18px -10px rgba(21, 94, 117, 0.25); transition: transform 0.15s;
}
.stat:hover { transform: translateY(-3px); }
.stat strong { display: block; font-size: 1.7rem; color: var(--turquoise); }
.stat span { font-size: 0.8rem; color: var(--muted); }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel {
  background: #fff; border-radius: var(--radius); padding: 22px;
  box-shadow: 0 6px 18px -10px rgba(21, 94, 117, 0.25); margin-bottom: 16px;
}
.panel h2 { font-size: 1.02rem; color: var(--ocean); margin-bottom: 12px; }
.mini-list { list-style: none; display: grid; gap: 10px; }
.mini-list li { display: grid; gap: 1px; border-bottom: 1px solid var(--mist); padding-bottom: 8px; font-size: 0.86rem; }
.mini-list li:last-child { border: 0; }
.mini-list em { color: var(--muted); font-style: normal; font-size: 0.75rem; }
.empty { color: var(--muted); font-size: 0.88rem; padding: 12px 0; text-align: center; }

.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th {
  text-align: left; padding: 10px 12px; color: var(--muted); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 2px solid var(--mist);
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--mist); vertical-align: middle; }
.table .actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.table td.wrap-text { max-width: 340px; }
.thumb { width: 54px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--mist); color: var(--muted); font-size: 0.72rem; font-weight: 600;
}
.badge.ok { background: #d9f2ee; color: #0c5c50; }

.btn {
  display: inline-block; background: var(--turquoise); color: #fff; border: 0;
  padding: 9px 18px; border-radius: 999px; font-weight: 600; font-size: 0.85rem;
  cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.btn:hover { background: #0aa2c7; transform: translateY(-1px); }
.btn.sm { padding: 5px 12px; font-size: 0.78rem; }
.btn.danger { background: #fde5e1; color: #a2372a; }
.btn.danger:hover { background: var(--coral); color: #fff; }
.btn.primary { padding: 11px 26px; }

.form { display: grid; gap: 18px; max-width: 760px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.86rem; }
.field small { color: var(--muted); font-size: 0.78rem; }
.field input[type='text'], .field input[type='email'], .field input[type='password'],
.field input[type='number'], .field input[type='date'], .field input[type='datetime-local'],
.field textarea, .field select {
  width: 100%; padding: 10px 13px; border: 1.5px solid #d6e6ea; border-radius: 10px;
  font: inherit; background: #fff; transition: border-color 0.2s;
}
.field :is(input, textarea, select):focus { outline: none; border-color: var(--turquoise); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.82rem; }
.switch { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; cursor: pointer; }
.image-field { display: flex; gap: 8px; }
.image-field input { flex: 1; }
.upload-btn { align-self: center; }
.preview { max-width: 220px; border-radius: 10px; margin-top: 6px; }

.rte-toolbar { display: flex; gap: 4px; margin-bottom: -6px; }
.rte-toolbar button {
  border: 1.5px solid #d6e6ea; background: #fff; border-radius: 8px;
  padding: 4px 10px; cursor: pointer; font-size: 0.8rem;
}
.rte-toolbar button:hover { border-color: var(--turquoise); }
.rte {
  min-height: 220px; border: 1.5px solid #d6e6ea; border-radius: 10px;
  padding: 12px 14px; background: #fff;
}
.rte:focus { outline: none; border-color: var(--turquoise); }
.rte h2 { font-size: 1.15rem; margin: 10px 0 6px; }
.rte p { margin-bottom: 8px; }

/* Login */
.login-page {
  display: grid; place-items: center; min-height: 100vh;
  background: linear-gradient(135deg, var(--ocean-deep), var(--turquoise));
}
.login-card {
  background: #fff; border-radius: 20px; padding: 40px;
  width: min(400px, 92%); display: grid; gap: 14px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.4);
}
.login-card h1 { font-size: 1.5rem; color: var(--ocean); text-align: center; }
.login-card h1 em { color: var(--turquoise); }
.login-card .sub {
  text-align: center; font-size: 0.72rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--muted); margin-top: -8px;
}
.login-card label { display: grid; gap: 5px; font-weight: 600; font-size: 0.86rem; }
.login-card input {
  padding: 11px 14px; border: 1.5px solid #d6e6ea; border-radius: 10px; font: inherit;
}
.login-card input:focus { outline: none; border-color: var(--turquoise); }
.login-card button {
  background: var(--turquoise); color: #fff; border: 0; padding: 12px;
  border-radius: 999px; font-weight: 700; font-size: 0.95rem; cursor: pointer;
}
.login-card button:hover { background: #0aa2c7; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .panel-grid { grid-template-columns: 1fr; }
  .content { padding: 20px; }
}

/* Structured JSON editor (json fields get a friendly form; raw is a toggle away) */
.je { display: grid; gap: 12px; }
.je-field { display: grid; gap: 4px; }
.je-field > label { font-weight: 500; font-size: 0.8rem; color: var(--muted); }
.je-legend {
  font-weight: 700; font-size: 0.74rem; color: var(--ocean);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.je-group {
  border: 1.5px solid var(--mist); border-radius: 10px; padding: 14px;
  display: grid; gap: 10px; background: var(--cream);
}
.je-list { display: grid; gap: 10px; }
.je-item {
  border: 1.5px dashed var(--mist); background: #fff; border-radius: 10px;
  padding: 12px; display: grid; gap: 8px;
}
.je-item .je-remove { justify-self: end; }
.je-add { justify-self: start; }
.je-toggle {
  justify-self: start; background: none; border: 0; padding: 0;
  color: var(--muted); font-size: 0.76rem; cursor: pointer; text-decoration: underline;
}
.je-toggle:hover { color: var(--turquoise); }
.je .preview { max-width: 160px; }
