:root {
      --bg: #f2f7f5;
      --bg-2: #f8faf9;
      --surface: rgba(255, 255, 255, 0.95);
      --surface-2: #ffffff;
      --line: rgba(15, 23, 42, 0.08);
      --text: #1a2a24;
      --muted: #6e847c;
      --blue: #00cd96;
      --blue-2: #00b080;
      --blue-3: #f0fbf7;
      --green: #00cd96;
      --orange: #f59f0b;
      --red: #ef4444;
      --purple: #7c3aed;
      --shadow: 0 22px 60px rgba(11, 46, 32, 0.06);
      --radius-xl: 28px;
      --radius-lg: 20px;
      --radius-md: 16px;
      --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
      margin: 0;
      font-family: "Inter", sans-serif;
      color: var(--text);
      background:
        radial-gradient(circle at top left, rgba(0, 205, 150, 0.08), transparent 24%),
        radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.08), transparent 22%),
        linear-gradient(180deg, #edf2ff 0%, #f7f9ff 100%);
      min-height: 100vh;
}

body::before,
body::after {
      display: none;
      content: "";
      position: fixed;
      inset: auto;
      width: 320px;
      height: 320px;
      border-radius: 50%;
      background: rgba(0, 205, 150, 0.08);
      /* filter: blur(40px); - Removed for safari grid bug */
      z-index: -1;
      pointer-events: none;
}

body::before { top: -80px; left: -120px; }
body::after { right: -120px; bottom: -120px; background: rgba(124, 58, 237, 0.09); }

.shell {
      position: relative;
      z-index: 10;
      display: grid;
      grid-template-columns: 280px 1fr;
      gap: 24px;
      padding: 26px;
      min-height: 100vh;
      max-width: 1600px;
      margin: 0 auto;
}

.sidebar {
      background: linear-gradient(180deg, #00cd96 0%, #00b080 100%);
      color: #fff;
      border-radius: 30px;
      padding: 22px 18px;
      box-shadow: var(--shadow);
      display: flex;
      flex-direction: column;
      gap: 18px;
      position: sticky;
      top: 26px;
      height: calc(100vh - 52px);
      overflow: hidden;
}

.brand {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 12px 20px;
      border-bottom: 1px solid rgba(255,255,255,.14);
}

.brand-badge {
      width: 46px;
      height: 46px;
      border-radius: 16px;
      background: rgba(255,255,255,.08);
      display: grid;
      place-items: center;
      font-size: 20px;
      /* backdrop-filter: blur(10px); - Removed for safari grid bug */
}

.brand h1 {
      margin: 0;
      font-size: 18px;
      font-weight: 800;
      letter-spacing: .2px;
}

.brand p {
      margin: 3px 0 0;
      color: rgba(255,255,255,.72);
      font-size: 12px;
}

.nav-group-title {
      padding: 0 12px;
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1.3px;
      color: rgba(255,255,255,.58);
      margin-top: 2px;
}

.nav {
      display: grid;
      gap: 8px;
      overflow: auto;
      padding-right: 4px;
}

.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 999px; }

.nav-link {
      border: 0;
      background: transparent;
      color: rgba(255,255,255,.84);
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 14px;
      border-radius: 16px;
      font: inherit;
      font-size: 15px;
      font-weight: 600;
      text-align: left;
      cursor: pointer;
      transition: .25s ease;
      width: 100%;
      text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
      color: #059669;
      background: #fff;
      transform: translateX(2px);
      box-shadow: 0 12px 28px rgba(6, 78, 59, 0.2);
}

.nav-link .icon {
      width: 18px;
      height: 18px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      flex-shrink: 0;
}

.sidebar-footer {
      margin-top: auto;
      padding: 14px 12px 8px;
      border-top: 1px solid rgba(255,255,255,.14);
      display: grid;
      gap: 12px;
}

.mini-card {
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.14);
      border-radius: 18px;
      padding: 14px;
      /* backdrop-filter: blur(10px); - Removed for safari grid bug */
}

.mini-card h3 {
      margin: 0 0 6px;
      font-size: 13px;
}

.mini-card p {
      margin: 0;
      font-size: 12px;
      line-height: 1.55;
      color: rgba(255,255,255,.74);
}

.content {
      background: rgba(255,255,255,.45);
      border-radius: 34px;
      padding: 18px;
      /* backdrop-filter: blur(16px); - Removed for safari grid bug */
}

.main-card {
      background: var(--surface);
      border: 1px solid rgba(255,255,255,.66);
      border-radius: 30px;
      box-shadow: var(--shadow);
      min-height: calc(100vh - 88px);
      overflow: hidden;
}

.topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      padding: 26px 28px 16px;
      border-bottom: 1px solid var(--line);
      background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(255,255,255,.92) 100%);
      position: sticky;
      top: 0;
      z-index: 5;
      /* backdrop-filter: blur(16px); - Removed for safari grid bug */
}

.page-heading h2 {
      margin: 0;
      font-size: 28px;
      font-weight: 800;
      letter-spacing: -.4px;
}

.page-heading p {
      margin: 6px 0 0;
      color: var(--muted);
      font-size: 14px;
}

.topbar-actions {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
}

.search {
      display: flex;
      align-items: center;
      gap: 10px;
      background: var(--bg-2);
      border: 1px solid var(--line);
      border-radius: 16px;
      padding: 0 14px;
      min-width: 280px;
      height: 48px;
}

.search input,
.field input,
.field select,
.field textarea,
.filter-chip select {
      font: inherit;
      border: none;
      outline: none;
      background: transparent;
      width: 100%;
      color: var(--text);
}

.search input::placeholder,
.field input::placeholder,
.field textarea::placeholder { color: #9aa4b7; }

.icon-btn,
.primary-btn,
.secondary-btn,
.ghost-btn {
      border: none;
      font: inherit;
      cursor: pointer;
      transition: .25s ease;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      justify-content: center;
}

.icon-btn {
      width: 48px;
      height: 48px;
      border-radius: 16px;
      background: var(--bg-2);
      border: 1px solid var(--line);
      color: var(--text);
}

.icon-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover { transform: translateY(-1px); }

.primary-btn {
      height: 48px;
      padding: 0 18px;
      border-radius: 16px;
      background: linear-gradient(135deg, var(--blue), var(--blue-2));
      color: #fff;
      box-shadow: 0 14px 30px rgba(0, 205, 150,.22);
      font-weight: 700;
}

.secondary-btn,
.ghost-btn {
      height: 42px;
      padding: 0 14px;
      border-radius: 14px;
      background: #fff;
      border: 1px solid var(--line);
      color: var(--text);
      font-weight: 600;
}

.avatar {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 6px 8px 6px 6px;
      border-radius: 18px;
      background: #fff;
      border: 1px solid var(--line);
}

.avatar-badge {
      width: 38px;
      height: 38px;
      border-radius: 14px;
      background: linear-gradient(135deg, #00cd96, #7c3aed);
      color: #fff;
      display: grid;
      place-items: center;
      font-size: 13px;
      font-weight: 800;
}

.avatar small {
      display: block;
      color: var(--muted);
      font-size: 11px;
      margin-top: 2px;
}

.page {
      display: block;
      padding: 24px 28px 30px;
      animation: fade .28s ease;
}

@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      flex-wrap: wrap;
      margin-bottom: 20px;
}

.filter-row {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
}

.filter-chip {
      height: 42px;
      border-radius: 14px;
      background: #fff;
      border: 1px solid var(--line);
      padding: 0 14px;
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--muted);
}

.stats-grid,
.card-grid,
.analytics-grid,
.settings-grid,
.security-grid,
.two-col,
.three-col,
.seo-grid,
.finance-grid {
      display: grid;
      gap: 18px;
}

.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.analytics-grid { grid-template-columns: 1.3fr .9fr; }
.settings-grid { grid-template-columns: 1.2fr .8fr; }
.security-grid { grid-template-columns: 1fr 1fr; }
.two-col { grid-template-columns: 1.1fr .9fr; }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seo-grid { grid-template-columns: 1.15fr .85fr; }
.finance-grid { grid-template-columns: 1.1fr .9fr; }

.panel,
.stat-card,
.list-item,
.reader-card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 22px;
      box-shadow: 0 16px 35px rgba(20, 32, 59, 0.05);
}

.panel { padding: 20px; }

.panel-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 16px;
}

.panel-title {
      margin: 0;
      font-size: 17px;
      font-weight: 800;
      letter-spacing: -.2px;
}

.panel-subtitle {
      margin: 6px 0 0;
      color: var(--muted);
      font-size: 13px;
}

.stat-card {
      padding: 18px;
      position: relative;
      overflow: hidden;
}

.stat-card::after {
      content: "";
      position: absolute;
      right: -24px;
      top: -24px;
      width: 100px;
      height: 100px;
      border-radius: 50%;
      background: rgba(16,185,129,.06);
}

.stat-top {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      align-items: center;
      margin-bottom: 24px;
      position: relative;
      z-index: 1;
}

.stat-icon {
      width: 48px;
      height: 48px;
      border-radius: 16px;
      display: grid;
      place-items: center;
      background: var(--blue-3);
      color: var(--blue);
      font-size: 20px;
      font-weight: 700;
}

.trend {
      border-radius: 999px;
      padding: 7px 10px;
      font-size: 12px;
      font-weight: 700;
      background: #eefbf5;
      color: #159c69;
}

.trend.down { background: #fff4f4; color: #df3d3d; }

.stat-value {
      font-size: 32px;
      font-weight: 800;
      line-height: 1;
      margin-bottom: 8px;
      position: relative;
      z-index: 1;
}

.stat-label {
      color: var(--muted);
      font-size: 13px;
      position: relative;
      z-index: 1;
}

.hero-banner {
      background: linear-gradient(135deg, #00cd96 0%, #00b080 55%, #7c3aed 100%);
      color: #fff;
      border-radius: 24px;
      padding: 24px;
      display: grid;
      grid-template-columns: 1.2fr .8fr;
      gap: 20px;
      box-shadow: 0 22px 45px rgba(36, 76, 205, 0.2);
      overflow: hidden;
      position: relative;
}

.hero-banner::after {
      content: "";
      position: absolute;
      width: 220px;
      height: 220px;
      border-radius: 50%;
      right: -40px;
      top: -40px;
      background: rgba(255,255,255,.12);
}

.hero-banner h3 {
      margin: 0 0 10px;
      font-size: 26px;
      font-weight: 800;
      max-width: 520px;
}

.hero-banner p {
      margin: 0;
      color: rgba(255,255,255,.84);
      max-width: 600px;
      line-height: 1.65;
      font-size: 14px;
}

.hero-meta {
      display: grid;
      grid-template-columns: repeat(3, minmax(0,1fr));
      gap: 10px;
      align-self: end;
      position: relative;
      z-index: 1;
}

.hero-pill {
      background: rgba(255,255,255,.12);
      border: 1px solid rgba(255,255,255,.16);
      padding: 14px;
      border-radius: 18px;
      /* backdrop-filter: blur(8px); - Removed for safari grid bug */
}

.hero-pill strong {
      display: block;
      font-size: 20px;
      margin-bottom: 4px;
}

.hero-pill span {
      color: rgba(255,255,255,.76);
      font-size: 12px;
}

table {
      width: 100%;
      border-collapse: collapse;
}

th, td {
      text-align: left;
      padding: 14px 12px;
      border-bottom: 1px solid var(--line);
      font-size: 13px;
      vertical-align: middle;
}

th {
      color: var(--muted);
      font-weight: 700;
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: .4px;
}

tbody tr:hover { background: #fbfcff; }
tbody tr.hoverable-row {
      cursor: pointer;
      transition: background 0.25s ease;
}
tbody tr.hoverable-row:hover {
      background: rgba(0, 205, 150, 0.05) !important;
}

.table-wrap {
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 18px;
}

.status,
.badge {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 7px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
}

.dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: currentColor;
      opacity: .85;
}

.status.pending { background: #fff4e7; color: #d68a00; }
.status.live, .status.completed, .status.verified, .status.resolved, .badge.green { background: #eafaf3; color: #159c69; }
.status.cancelled, .status.blocked, .badge.red { background: #fff1f2; color: #e43b4d; }
.status.review, .badge.blue { background: #edf3ff; color: #00cd96; }
.status.warning, .badge.orange { background: #fff5e7; color: #f59f0b; }
.status.draft, .badge.gray { background: #f3f4f6; color: #6b7280; }

.user-cell,
.reader-cell {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 170px;
}

.avatar-sm {
      width: 36px;
      height: 36px;
      border-radius: 12px;
      display: grid;
      place-items: center;
      color: #fff;
      font-weight: 800;
      font-size: 12px;
      background: linear-gradient(135deg, #00cd96, #7c3aed);
      flex-shrink: 0;
}

.avatar-sm.alt { background: linear-gradient(135deg, #1fb981, #0ea5e9); }
.avatar-sm.orange { background: linear-gradient(135deg, #f59f0b, #ef4444); }

.muted { color: var(--muted); }

.tiny-chart {
      display: flex;
      align-items: flex-end;
      gap: 8px;
      height: 160px;
      padding-top: 10px;
}

.bar {
      flex: 1;
      border-radius: 14px 14px 6px 6px;
      background: linear-gradient(180deg, rgba(16,185,129,.9), rgba(16,185,129,.22));
      min-width: 34px;
      position: relative;
}

.bar span {
      position: absolute;
      bottom: -26px;
      left: 50%;
      transform: translateX(-50%);
      color: var(--muted);
      font-size: 11px;
      font-weight: 600;
}

.progress-list,
.activity-list,
.check-list,
.ticket-list,
.priority-list,
.timeline {
      display: grid;
      gap: 12px;
}

.list-item,
.reader-card {
      padding: 16px;
}

.progress-head,
.row-between {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
}

.progress-track {
      width: 100%;
      height: 10px;
      background: #edf2f8;
      border-radius: 999px;
      overflow: hidden;
      margin-top: 10px;
}

.progress-fill {
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, #00cd96, #7c3aed);
}

.reader-card {
      display: grid;
      gap: 14px;
}

.reader-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
}

.reader-info {
      display: flex;
      gap: 14px;
      align-items: center;
}

.reader-avatar {
      width: 58px;
      height: 58px;
      border-radius: 18px;
      background: linear-gradient(135deg, #00cd96, #7c3aed);
      color: white;
      display: grid;
      place-items: center;
      font-weight: 800;
      font-size: 18px;
      flex-shrink: 0;
}

.rating {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      color: #f59f0b;
      font-weight: 700;
      font-size: 13px;
}

.tag-row,
.capsules {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
}

.tag {
      border-radius: 999px;
      padding: 7px 10px;
      font-size: 12px;
      font-weight: 600;
      background: #f2f6ff;
      color: #065f46;
}

.metric-line {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
}

.metric-pill {
      flex: 1;
      min-width: 110px;
      background: #f8faff;
      border: 1px solid #ecf1ff;
      border-radius: 16px;
      padding: 12px;
}

.metric-pill strong {
      display: block;
      font-size: 18px;
      margin-bottom: 4px;
}

.form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
}

.field {
      display: grid;
      gap: 8px;
}

.field label {
      font-size: 12px;
      font-weight: 700;
      color: #50607f;
      letter-spacing: .2px;
}

.field input,
.field select,
.field textarea {
      height: 48px;
      border-radius: 14px;
      border: 1px solid var(--line);
      padding: 0 14px;
      background: #fbfcff;
}

.field textarea {
      min-height: 120px;
      padding: 14px;
      resize: vertical;
}

.switch-row,
.setting-row,
.security-row,
.check-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      padding: 14px 0;
      border-bottom: 1px solid var(--line);
}

.switch-row:last-child,
.setting-row:last-child,
.security-row:last-child,
.check-row:last-child { border-bottom: none; }

.toggle {
      width: 52px;
      height: 30px;
      border-radius: 999px;
      background: #dce4f4;
      position: relative;
      flex-shrink: 0;
}

.toggle::after {
      content: "";
      position: absolute;
      width: 22px;
      height: 22px;
      top: 4px;
      left: 4px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 3px 10px rgba(15, 23, 42, .18);
}

.toggle.on {
      background: linear-gradient(135deg, #00cd96, #2d69ff);
}

.toggle.on::after { left: 26px; }

.timeline-item {
      display: grid;
      grid-template-columns: 18px 1fr;
      gap: 12px;
      align-items: start;
}

.timeline-dot {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: linear-gradient(135deg, #00cd96, #7c3aed);
      margin-top: 6px;
      box-shadow: 0 0 0 6px rgba(16,185,129,.1);
}

.calendar-box {
      background: linear-gradient(180deg, #f8fbff, #fff);
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 16px;
}

.calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 8px;
      margin-top: 14px;
}

.day-label,
.day-cell {
      text-align: center;
      padding: 10px 0;
      border-radius: 12px;
      font-size: 12px;
}

.day-label { color: var(--muted); font-weight: 700; }
.day-cell { background: #fff; border: 1px solid #eef2fb; font-weight: 600; }
.day-cell.active { background: linear-gradient(135deg, #00cd96, #cbfbf1); color: #fff; box-shadow: 0 10px 18px rgba(16,185,129,.18); }
.day-cell.dim { color: #a0adc4; }

.kpi-inline {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
}

.kpi-inline .badge { padding: 9px 12px; }

.seo-preview {
      border: 1px dashed #ced7eb;
      background: #fbfdff;
      border-radius: 18px;
      padding: 16px;
}

.seo-preview .url {
      color: #1a7f37;
      font-size: 13px;
      margin-bottom: 4px;
}

.seo-preview h4 {
      margin: 0 0 6px;
      color: #1a0dab;
      font-size: 20px;
}

.seo-preview p {
      margin: 0;
      color: #525d74;
      font-size: 14px;
      line-height: 1.6;
}

.split-line {
      height: 1px;
      background: var(--line);
      margin: 18px 0;
}

.footer-note {
      text-align: center;
      color: var(--muted);
      font-size: 12px;
      padding-top: 6px;
}

@media (max-width: 1360px) {
      .stats-grid, .card-grid, .analytics-grid, .settings-grid, .security-grid, .two-col, .three-col, .seo-grid, .finance-grid {
        grid-template-columns: 1fr;
      }
      .hero-banner { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
      .shell {
        grid-template-columns: 1fr;
      }
      .sidebar {
        position: relative;
        top: 0;
        height: auto;
      }
}

@media (max-width: 820px) {
      .topbar,
      .page-actions {
        align-items: stretch;
      }
      .topbar,
      .page-actions,
      .topbar-actions,
      .search,
      .form-grid {
        display: grid;
      }
      .search { min-width: 100%; }
      .stats-grid { grid-template-columns: 1fr; }
      .content { padding: 10px; }
      .page { padding: 18px; }
      .topbar { padding: 18px; }
}


/* Live Search Dropdown */
.search { position: relative; overflow: visible; }
.live-search-dropdown { position: absolute; top: calc(100% + 8px); left: 0; min-width: 320px; background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,0.08); border-radius: 12px; border: 1px solid var(--line); z-index: 9999; display: none; margin: 0; padding: 8px 0; max-height: 400px; overflow-y: auto; text-transform:none; }
.ls-section { padding: 4px 8px; }
.ls-title { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 4px; padding-left: 8px; letter-spacing: 0.5px; }
.ls-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; text-decoration: none; border-radius: 6px; transition: 0.15s; }
.ls-item:hover { background: rgba(0, 205, 150, 0.05); }
.ls-item .ls-primary { font-size: 13px; font-weight: 600; color: var(--text-base); }
.ls-item .ls-secondary { font-size: 11px; color: var(--muted); }
.ls-item mark { background: transparent; color: #00cd96; padding: 0; font-weight: 700; }
.ls-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }
