/* Panel — nasljeđuje boje/fontove iz /style.css (linkovano prije ovog fajla) */

body { cursor: auto; }
a, button, input, textarea, select { cursor: auto; }

.panel-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5,7,13,0.94);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.panel-topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-topbar-right { display: flex; align-items: center; gap: 20px; }
.panel-user { font-size: 0.85rem; color: var(--muted); }
.panel-user strong { color: #fff; }
.panel-links { display: flex; gap: 20px; }
.panel-links a { color: var(--muted); font-size: 0.85rem; text-decoration: none; transition: color 0.2s; }
.panel-links a:hover, .panel-links a.active { color: #fff; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }

.panel-main { max-width: 1100px; margin: 0 auto; padding: 48px 28px 80px; }
.panel-head { margin-bottom: 36px; }
.panel-head h1 { font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 6px; }
.panel-head p { color: var(--muted); font-size: 0.92rem; }

/* Auth pages (login/register) */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 40px;
}
.auth-logo { display: inline-flex; justify-content: center; margin-bottom: 28px; width: 100%; }
.auth-card h1 { font-family: 'Syne', sans-serif; font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; text-align: center; }
.auth-card .auth-sub { color: var(--muted); font-size: 0.85rem; text-align: center; margin-bottom: 28px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card .btn-submit { margin-top: 6px; }
.auth-switch { text-align: center; font-size: 0.85rem; color: var(--muted); margin-top: 20px; }
.auth-switch a { color: var(--orange); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { color: var(--pink); }

.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  cursor: pointer;
}
.terms-check input { margin-top: 3px; flex-shrink: 0; }
.terms-check a { color: var(--orange); text-decoration: none; }
.terms-check a:hover { color: var(--pink); }

.form-msg {
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: 8px;
  display: none;
}
.form-msg.show { display: block; }
.form-msg.error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #f87171; }
.form-msg.success { background: rgba(22,163,74,0.1); border: 1px solid rgba(22,163,74,0.25); color: #4ade80; }

/* Section blocks in dashboard */
.panel-section { margin-bottom: 48px; }
.panel-section h2 { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 18px; }

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--r);
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Hosting account cards */
.hosting-list { display: flex; flex-direction: column; gap: 2px; background: var(--border); border-radius: var(--r); overflow: hidden; }
.hosting-card { background: var(--surface); padding: 24px 28px; }
.hc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.hc-main { display: flex; flex-direction: column; gap: 4px; }
.hc-domain { font-family: 'Syne', sans-serif; font-size: 1.05rem; font-weight: 700; }
.hc-meta { font-size: 0.8rem; color: var(--muted); }
.hc-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.status-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 100px;
}
.status-badge.provisioning { background: rgba(47,143,255,0.12); color: var(--orange); }
.status-badge.active { background: rgba(22,163,74,0.15); color: #4ade80; }
.status-badge.suspended { background: rgba(239,68,68,0.12); color: #f87171; }
.status-badge.failed { background: rgba(239,68,68,0.18); color: #ef4444; }
.status-badge.unpaid { background: rgba(47,143,255,0.12); color: var(--orange); }
.status-badge.paid { background: rgba(22,163,74,0.15); color: #4ade80; }

/* Email nalozi (unutar hosting kartice) */
.email-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.email-toggle {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.email-toggle:hover { color: #fff; }
.email-toggle .chev { transition: transform 0.2s; font-size: 0.7rem; }
.email-toggle.open .chev { transform: rotate(90deg); }
.email-toggle .count { color: var(--orange); font-weight: 700; }

.email-body { margin-top: 16px; display: none; }
.email-body.open { display: block; }

.email-note { font-size: 0.82rem; color: var(--muted); }

.email-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 14px; }
.email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.email-row:first-child { border-top: none; }
.email-addr { font-weight: 600; }
.email-addr .at { color: var(--dim); }
.email-quota { color: var(--muted); font-size: 0.78rem; margin-left: 10px; }

.email-add-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.email-add-form input {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  outline: none;
  width: 160px;
  transition: border-color 0.2s;
}
.email-add-form input:focus { border-color: var(--orange); }
.email-add-domain { font-size: 0.85rem; color: var(--muted); }
.btn-small {
  background: var(--grad);
  color: #fff;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 8px;
  transition: opacity 0.2s;
}
.btn-small:hover { opacity: 0.85; }

.btn-danger-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  transition: all 0.2s;
}
.btn-danger-ghost:hover { border-color: #f87171; color: #f87171; }

/* Order form */
.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 32px;
}
.order-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.pkg-pick {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s;
}
.pkg-pick:hover { border-color: rgba(47,143,255,0.4); }
.pkg-pick.selected { border-color: var(--orange); background: rgba(47,143,255,0.06); }
.pkg-pick input { display: none; }
.pkg-pick .pp-name { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1rem; margin-bottom: 4px; }
.pkg-pick .pp-price { font-size: 0.85rem; color: var(--orange); font-weight: 700; margin-bottom: 8px; }
.pkg-pick .pp-spec { font-size: 0.76rem; color: var(--muted); }
.order-form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.order-form-row .f-group { flex: 1; min-width: 220px; }
.order-form-row .btn-submit { width: auto; padding: 12px 24px; margin-top: 0; }

/* Admin tables */
.admin-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow-x: auto;
}
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.admin-table th {
  text-align: left;
  padding: 14px 20px;
  color: var(--dim);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.admin-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
}
.role-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--surface-2);
  color: var(--muted);
}
.role-badge.admin { background: var(--grad); color: #fff; }

/* =====================
   KALENDAR
   ===================== */
:root {
  /* Kategorijalna paleta, validirana dataviz skriptom (5 slotova, dark mode,
     surface #141414) — CVD razdvojenost i kontrast provjereni, ne pogađani. */
  --cal-seo:      #3987e5;
  --cal-backlink: #d95926;
  --cal-klijent:  #199e70;
  --cal-analiza:  #c98500;
  --cal-ostalo:   #d55181;
}

.cal-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cal-nav-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-transform: capitalize;
}
.cal-nav-btns { display: flex; gap: 8px; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.cal-weekday {
  background: var(--surface);
  padding: 10px 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
}
.cal-day {
  background: var(--surface);
  min-height: 96px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-day.other-month { background: var(--bg); }
.cal-day.other-month .cal-day-num { color: var(--dim); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--orange); }
.cal-day-num { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.cal-day.today .cal-day-num { color: var(--orange); }

.cal-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cal-chip .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cal-chip.done { opacity: 0.45; text-decoration: line-through; }
.cal-day-more { font-size: 0.65rem; color: var(--dim); padding-left: 2px; }

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 14px 0 20px;
}
.cal-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); }
.cal-legend-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.cal-sidebar { display: flex; flex-direction: column; gap: 20px; }
.cal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
}
.cal-box h3 {
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.cal-box form { display: flex; flex-direction: column; gap: 12px; }
.cal-box .f-group input,
.cal-box .f-group select,
.cal-box .f-group textarea { font-size: 0.85rem; padding: 9px 12px; }

.cal-agenda-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}
.cal-agenda-item:first-child { border-top: none; }
.cal-agenda-item .dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.cal-agenda-date { color: var(--dim); font-size: 0.72rem; display: block; }
.cal-agenda-item.overdue .cal-agenda-date { color: #f87171; font-weight: 700; }

@media (max-width: 900px) {
  .cal-layout { grid-template-columns: 1fr; }
}

/* =====================
   WEBMAIL
   ===================== */
.wm-banner {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(47,143,255,0.08);
  border: 1px solid rgba(47,143,255,0.22);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.wm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}
.wm-address {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.wm-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2px;
  background: var(--border);
  border-radius: var(--r);
  overflow: hidden;
  min-height: 480px;
}

.wm-list {
  background: var(--surface);
  overflow-y: auto;
  max-height: 640px;
}
.wm-msg-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.wm-msg-row:hover { background: var(--surface-2); }
.wm-msg-row.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--orange); }
.wm-msg-from { font-size: 0.82rem; color: var(--muted); }
.wm-msg-row.unread .wm-msg-from { color: #fff; font-weight: 700; }
.wm-msg-subject { font-size: 0.85rem; color: var(--text); }
.wm-msg-row.unread .wm-msg-subject { font-weight: 700; }
.wm-msg-date { font-size: 0.7rem; color: var(--dim); }

.wm-pane {
  background: var(--surface);
  padding: 32px;
  overflow-y: auto;
  max-height: 640px;
}
.wm-pane-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--dim);
  font-size: 0.88rem;
}
.wm-msg-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.wm-msg-header h2 { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.wm-msg-meta { font-size: 0.82rem; color: var(--muted); }
.wm-msg-body { font-size: 0.9rem; color: var(--text); line-height: 1.75; }
.wm-msg-body a { color: var(--orange); }

.wm-compose { display: flex; flex-direction: column; gap: 14px; }
.wm-compose textarea { resize: vertical; }

@media (max-width: 800px) {
  .wm-layout { grid-template-columns: 1fr; }
  .wm-list { max-height: 240px; }
}
@media (max-width: 720px) {
  .order-grid { grid-template-columns: 1fr; }
  .hosting-card { flex-direction: column; align-items: flex-start; }
  .cal-day { min-height: 64px; padding: 5px; }
  .cal-weekday { font-size: 0.6rem; padding: 6px 2px; }

  /* Topbar: navigacija se ne gubi na mobilnom, prelazi u drugi red umjesto
     da nestane (ranije je bila potpuno sakrivena bez ikakve zamjene). */
  .panel-topbar-inner { flex-wrap: wrap; row-gap: 12px; }
  .panel-user { display: none; }
  .panel-topbar-right { width: 100%; justify-content: space-between; gap: 12px; }
  .panel-links {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 20px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  .panel-main { padding: 32px 20px 60px; }
  .wm-pane { padding: 20px; }
  .order-form-row .f-group { min-width: 100%; }
}
