/* ===========================
   FixPro — Design System
   =========================== */

:root {
  /* Brand */
  --brand:        #0EB781;
  --brand-dark:   #0a9469;
  --brand-light:  #e8f9f3;
  --brand-pale:   #f0fcfa;
  --brand-shadow: rgba(14,183,129,.25);

  /* Neutrals */
  --n-900: #0f1419;
  --n-800: #1a1f2e;
  --n-700: #2c3142;
  --n-600: #4a5265;
  --n-500: #6b7280;
  --n-400: #9ca3af;
  --n-300: #d1d5db;
  --n-200: #e5e7eb;
  --n-100: #f3f4f6;
  --n-50:  #fafbfc;
  --white: #ffffff;

  /* Semantic */
  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;

  --success-bg: rgba(16,185,129,.1);
  --warning-bg: rgba(245,158,11,.1);
  --danger-bg:  rgba(239,68,68,.1);
  --info-bg:    rgba(59,130,246,.1);

  /* Shadows */
  --s-sm: 0 1px 2px rgba(0,0,0,.05);
  --s-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --s-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --s-xl: 0 20px 25px rgba(0,0,0,.15);
  --s-2xl: 0 25px 50px rgba(0,0,0,.2);

  /* Radii */
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-2xl:  24px;
  --r-full: 9999px;

  /* Layout */
  --nav-h:   64px;
  --bc-h:    44px;
  --font:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--n-800); background: var(--n-100); line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; }

/* ===========================
   TOP NAVIGATION
   =========================== */

.nav {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  background: var(--white);
  border-bottom: 1px solid var(--n-200);
  box-shadow: var(--s-sm);
}

.nav__inner {
  display: flex; align-items: center;
  height: 100%; padding: 0 24px;
  max-width: 1400px; margin: 0 auto;
  gap: 40px;
}

.nav__logo {
  font-size: 1.25rem; font-weight: 800;
  color: var(--n-900); text-decoration: none;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.nav__logo span { color: var(--brand); }
.nav__logo svg { width: 28px; height: 28px; }

.nav__links {
  display: flex; gap: 4px;
  list-style: none; flex: 1;
}

.nav__links a {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: .9rem; font-weight: 500;
  color: var(--n-600);
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.nav__links a:hover { background: var(--n-100); color: var(--n-900); }
.nav__links a.active { background: var(--brand-light); color: var(--brand); }

.nav__right {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; margin-left: auto;
}

/* Bell */
.nav__bell {
  position: relative;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--n-500);
  cursor: pointer; border: none; background: none;
  transition: background .15s, color .15s;
}
.nav__bell:hover { background: var(--n-100); color: var(--n-800); }
.nav__bell-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%;
  border: 2px solid var(--white);
}

/* Avatar */
.nav__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
  flex-shrink: 0;
  transition: box-shadow .15s;
}
.nav__avatar:hover { box-shadow: 0 0 0 3px var(--brand-light); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown__menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  box-shadow: var(--s-xl);
  padding: 8px;
  display: none;
  z-index: 300;
}
.dropdown__menu.open { display: block; }
.dropdown__header {
  padding: 8px 12px 12px;
  border-bottom: 1px solid var(--n-200);
  margin-bottom: 8px;
}
.dropdown__name { font-weight: 600; font-size: .9rem; }
.dropdown__email { font-size: .8rem; color: var(--n-500); }
.dropdown__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: .875rem; color: var(--n-700);
  cursor: pointer; text-decoration: none;
  transition: background .12s;
}
.dropdown__item:hover { background: var(--n-100); text-decoration: none; }
.dropdown__item--danger { color: var(--danger); }
.dropdown__item--danger:hover { background: var(--danger-bg); }
.dropdown__divider { height: 1px; background: var(--n-200); margin: 8px 0; }

/* ===========================
   BREADCRUMB
   =========================== */

.breadcrumb {
  height: var(--bc-h);
  display: flex; align-items: center;
  padding: 0 24px;
  background: var(--n-50);
  border-bottom: 1px solid var(--n-200);
  font-size: .82rem;
  gap: 6px;
}
.breadcrumb a { color: var(--brand); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--n-400); }
.breadcrumb strong { color: var(--n-700); font-weight: 600; }

/* ===========================
   LAYOUT
   =========================== */

.main { padding: 32px 0 80px; }

.container {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
}
.container--sm { max-width: 720px; margin: 0 auto; padding: 0 24px; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 28px;
}
.page-head h1 { font-size: 1.5rem; font-weight: 700; color: var(--n-900); }
.page-head p  { font-size: .9rem; color: var(--n-500); margin-top: 2px; }

/* ===========================
   AUTH PAGES
   =========================== */

.auth-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  padding: 24px; background: var(--n-100);
}

.auth-box {
  background: var(--white);
  border: 1px solid var(--n-200);
  border-radius: var(--r-xl);
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--s-lg);
}
.auth-box--wide { max-width: 520px; }

.auth-logo {
  font-size: 1.5rem; font-weight: 800;
  color: var(--n-900); margin-bottom: 28px;
  display: block;
}
.auth-logo span { color: var(--brand); }

.auth-box h1 { font-size: 1.35rem; font-weight: 700; margin-bottom: 24px; }
.auth-box p.sub { color: var(--n-500); font-size: .9rem; margin-top: -16px; margin-bottom: 24px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: .875rem; color: var(--n-500); }

/* ===========================
   FORMS
   =========================== */

.form { display: flex; flex-direction: column; gap: 20px; }

.form__group { display: flex; flex-direction: column; gap: 6px; }

.form__group label {
  font-size: .82rem; font-weight: 600;
  color: var(--n-700); text-transform: uppercase; letter-spacing: .04em;
}

.form__group input,
.form__group textarea,
.form__group select {
  height: 44px; padding: 0 14px;
  border: 1px solid var(--n-300); border-radius: var(--r-md);
  font-family: var(--font); font-size: .95rem;
  color: var(--n-900); background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.form__group textarea { height: auto; padding: 12px 14px; min-height: 110px; resize: vertical; }
.form__group input:focus,
.form__group textarea:focus,
.form__group select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-shadow);
}
.form__group input::placeholder,
.form__group textarea::placeholder { color: var(--n-400); }

.form__actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; }

/* Radio options */
.radio-opts { display: flex; flex-direction: column; gap: 10px; }
.radio-opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--n-200); border-radius: var(--r-md);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.radio-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-pale); }
.radio-opt input { margin-top: 2px; accent-color: var(--brand); }
.radio-opt strong { display: block; font-size: .9rem; margin-bottom: 2px; }
.radio-opt small { font-size: .8rem; color: var(--n-500); }

/* ===========================
   BUTTONS
   =========================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--r-md);
  font-family: var(--font); font-size: .875rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none; white-space: nowrap;
  transition: all .18s cubic-bezier(.4,0,.2,1);
}
.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--brand); color: var(--white); border-color: var(--brand);
  box-shadow: 0 4px 12px var(--brand-shadow);
}
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); transform: translateY(-1px); color: var(--white); }
.btn--primary:active { transform: translateY(0); }

.btn--outline {
  background: transparent; color: var(--n-700); border-color: var(--n-300);
}
.btn--outline:hover { border-color: var(--n-500); background: var(--n-100); color: var(--n-900); }

.btn--ghost {
  background: transparent; color: var(--brand); border-color: var(--brand-light);
}
.btn--ghost:hover { background: var(--brand-light); }

.btn--danger { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn--danger:hover { background: #dc2626; color: var(--white); }

.btn--sm  { padding: 6px 12px; font-size: .8rem; border-radius: var(--r-sm); }
.btn--lg  { padding: 12px 24px; font-size: 1rem; }
.btn--full { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; pointer-events: none; }

/* Icon button */
.btn--icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: var(--r-sm);
}

/* ===========================
   CARDS
   =========================== */

.card {
  background: var(--white);
  border: 1px solid var(--n-200);
  border-radius: var(--r-xl);
  box-shadow: var(--s-sm);
  overflow: hidden;
}

.card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--n-200);
}
.card__head h2 { font-size: .95rem; font-weight: 600; }
.card__body { padding: 20px; }

/* ===========================
   SITE CARDS (My Sites)
   =========================== */

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.site-card {
  background: var(--white);
  border: 1px solid var(--n-200);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--s-sm);
  transition: box-shadow .2s, border-color .2s, transform .2s;
  cursor: pointer; text-decoration: none; display: block; color: inherit;
}
.site-card:hover {
  box-shadow: var(--s-lg);
  border-color: var(--brand);
  transform: translateY(-2px);
  text-decoration: none;
}

.site-card__preview {
  height: 150px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--n-800) 0%, var(--n-700) 100%);
  display: flex; align-items: center; justify-content: center;
}

.site-card__preview-iframe {
  width: 200%; height: 200%;
  transform: scale(.5); transform-origin: top left;
  pointer-events: none; border: none;
  position: absolute; top: 0; left: 0;
}

.site-card__preview-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--n-400);
}
.site-card__preview-placeholder svg { width: 40px; height: 40px; }

.site-card__status {
  position: absolute; top: 12px; right: 12px;
}

.site-card__body {
  padding: 16px 20px;
}

.site-card__name {
  font-size: 1rem; font-weight: 700; color: var(--n-900);
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.site-card__url {
  font-size: .8rem; color: var(--n-500);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 12px;
}

.site-card__meta {
  display: flex; gap: 12px; font-size: .78rem; color: var(--n-500);
}
.site-card__meta-item { display: flex; align-items: center; gap: 4px; }

.site-card__foot {
  padding: 12px 20px;
  border-top: 1px solid var(--n-100);
  display: flex; align-items: center; justify-content: space-between;
}

/* Add site card */
.site-card--add {
  border: 2px dashed var(--n-300);
  background: var(--n-50);
  min-height: 260px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
  color: var(--n-500); text-decoration: none;
  border-radius: var(--r-xl);
  transition: border-color .2s, background .2s, color .2s;
}
.site-card--add:hover {
  border-color: var(--brand); background: var(--brand-pale);
  color: var(--brand); text-decoration: none;
}
.site-card--add svg { width: 36px; height: 36px; }
.site-card--add span { font-size: .9rem; font-weight: 600; }

/* ===========================
   SITE DETAIL TABS
   =========================== */

.site-hero {
  background: linear-gradient(135deg, var(--n-900) 0%, var(--n-800) 100%);
  padding: 28px 24px;
  display: flex; align-items: center; gap: 24px;
}
.site-hero__preview {
  width: 120px; height: 80px;
  border-radius: var(--r-md); overflow: hidden;
  background: var(--n-700); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.site-hero__preview svg { color: var(--n-500); width: 32px; height: 32px; }
.site-hero__info { flex: 1; min-width: 0; }
.site-hero__name {
  font-size: 1.5rem; font-weight: 800; color: var(--white);
  margin-bottom: 4px;
}
.site-hero__url { font-size: .9rem; color: var(--brand); margin-bottom: 8px; }
.site-hero__url a { color: var(--brand); }
.site-hero__meta { font-size: .82rem; color: var(--n-400); display: flex; gap: 16px; }

.site-alert {
  background: #1c1a0f; border-bottom: 1px solid #3d3200;
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: .875rem; color: var(--warning);
}

.tab-nav {
  background: var(--white);
  border-bottom: 1px solid var(--n-200);
  display: flex; overflow-x: auto;
  padding: 0 24px; gap: 0;
  -webkit-overflow-scrolling: touch;
}
.tab-nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 14px 16px;
  font-size: .875rem; font-weight: 500;
  color: var(--n-500);
  border-bottom: 2px solid transparent;
  white-space: nowrap; text-decoration: none;
  transition: color .15s, border-color .15s;
}
.tab-nav a:hover { color: var(--n-800); text-decoration: none; }
.tab-nav a.active {
  color: var(--brand); border-bottom-color: var(--brand);
  font-weight: 600;
}

/* ===========================
   TASKS (per-site and global)
   =========================== */

.task-section {
  display: grid; grid-template-columns: 260px 1fr; gap: 24px;
}

.task-section__aside h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.task-section__aside p  { font-size: .85rem; color: var(--n-500); line-height: 1.6; }

.tasks-list { display: flex; flex-direction: column; gap: 1px; }
.task-item {
  background: var(--white);
  border: 1px solid var(--n-200);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  transition: box-shadow .15s, border-color .15s;
  margin-bottom: 8px;
  text-decoration: none; color: inherit;
}
.task-item:hover { box-shadow: var(--s-md); border-color: var(--n-300); text-decoration: none; }
.task-item__icon {
  width: 40px; height: 40px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.task-item__body { flex: 1; min-width: 0; }
.task-item__subject { font-weight: 600; font-size: .9rem; margin-bottom: 2px; }
.task-item__meta   { font-size: .78rem; color: var(--n-500); }
.task-item__right  { flex-shrink: 0; text-align: right; }

/* No tasks empty state */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 60px 24px;
  color: var(--n-400);
}
.empty svg { width: 48px; height: 48px; }
.empty h3  { font-size: 1rem; font-weight: 600; color: var(--n-600); }
.empty p   { font-size: .875rem; text-align: center; }

/* ===========================
   BADGES
   =========================== */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: .72rem; font-weight: 700; white-space: nowrap;
}

.badge--online, .badge--success, .badge--active {
  background: var(--success-bg); color: var(--success);
}
.badge--warning, .badge--in_progress {
  background: var(--warning-bg); color: var(--warning);
}
.badge--danger, .badge--error {
  background: var(--danger-bg); color: var(--danger);
}
.badge--open   { background: var(--info-bg); color: var(--info); }
.badge--closed { background: var(--n-100);   color: var(--n-500); }
.badge--task   { background: var(--warning-bg); color: var(--warning); }
.badge--support{ background: var(--info-bg); color: var(--info); }
.badge--unknown{ background: var(--n-100); color: var(--n-400); }

/* ===========================
   MODAL
   =========================== */

.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(15,20,25,.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--white);
  border-radius: var(--r-2xl);
  box-shadow: var(--s-2xl);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(20px) scale(.98);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal__head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--n-200);
  display: flex; align-items: center; justify-content: space-between;
}
.modal__title { font-size: 1.1rem; font-weight: 700; }
.modal__close {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: none; border: none; cursor: pointer;
  color: var(--n-400); font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.modal__close:hover { background: var(--n-100); color: var(--n-800); }
.modal__body { padding: 24px; }
.modal__foot {
  padding: 16px 24px; border-top: 1px solid var(--n-200);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ===========================
   ALERTS
   =========================== */

.alert {
  padding: 12px 16px; border-radius: var(--r-md);
  font-size: .875rem; margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid;
}
.alert--error   { background: var(--danger-bg);  color: #b91c1c; border-color: #fca5a5; }
.alert--success { background: var(--success-bg); color: #065f46; border-color: #6ee7b7; }
.alert--warning { background: var(--warning-bg); color: #92400e; border-color: #fcd34d; }
.alert--info    { background: var(--info-bg);    color: #1d4ed8; border-color: #93c5fd; }

/* ===========================
   TABLE
   =========================== */

.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  padding: 10px 16px; text-align: left;
  font-size: .72rem; font-weight: 700; color: var(--n-500);
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--n-200);
  background: var(--n-50);
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--n-100); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--n-50); }

/* ===========================
   ACCOUNT PAGE
   =========================== */

.account-hero {
  background: var(--white); border-bottom: 1px solid var(--n-200);
  padding: 40px 0 0;
  text-align: center;
}
.account-hero__avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--brand); color: var(--white);
  font-size: 2rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.account-hero__name { font-size: 1.5rem; font-weight: 700; }
.account-hero__email { color: var(--n-500); font-size: .9rem; margin-top: 4px; }
.account-tabs { display: flex; justify-content: center; gap: 0; margin-top: 24px; }

/* ===========================
   MONITORING (Uptime)
   =========================== */

.uptime-bar {
  display: flex; gap: 2px; height: 28px;
  border-radius: var(--r-sm); overflow: hidden;
}
.uptime-bar__tick {
  flex: 1; background: var(--success);
  border-radius: 2px;
  transition: opacity .15s;
}
.uptime-bar__tick--down   { background: var(--danger); }
.uptime-bar__tick--unknwon{ background: var(--n-300); }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px;
}
.stat-card {
  background: var(--white); border: 1px solid var(--n-200);
  border-radius: var(--r-lg); padding: 20px;
}
.stat-card__label { font-size: .78rem; font-weight: 600; color: var(--n-500); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.stat-card__value { font-size: 1.75rem; font-weight: 800; color: var(--n-900); }
.stat-card__sub   { font-size: .78rem; color: var(--n-500); margin-top: 4px; }

/* ===========================
   MISC
   =========================== */

.text-muted { color: var(--n-500); }
.text-sm    { font-size: .875rem; }
.fw-600     { font-weight: 600; }
.mt-4       { margin-top: 16px; }
.mb-4       { margin-bottom: 16px; }

.divider { height: 1px; background: var(--n-200); margin: 20px 0; }

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 768px) {
  .nav__links { display: none; }
  .sites-grid { grid-template-columns: 1fr; }
  .task-section { grid-template-columns: 1fr; }
  .task-section__aside { border-bottom: 1px solid var(--n-200); padding-bottom: 20px; }
  .site-hero { flex-direction: column; gap: 16px; }
  .site-hero__preview { display: none; }
  .auth-box { padding: 28px 20px; }
  .container { padding: 0 16px; }
  .page-head { flex-wrap: wrap; }
}
