:root {
  --blue: #3056d3;
  --blue-dark: #253fb0;
  --indigo: #4f3bd6;
  --blue-bg: #eef1fd;
  --bg: #f4f5fa;
  --card-bg: #ffffff;
  --border: #e4e7ee;
  --border-light: #edeff5;
  --text: #15182b;
  --text-secondary: #3c4257;
  --muted: #6b7190;
  --muted-light: #9ca0ba;
  --green: #1a9c6b;
  --green-bg: #e3f8ee;
  --red: #d7373f;
  --red-dark: #b42a30;
  --red-bg: #fdecec;
  --amber: #c2730a;
  --amber-bg: #fdf1dc;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(21, 24, 43, 0.05);
  --shadow-md: 0 10px 24px -8px rgba(21, 24, 43, 0.12), 0 2px 6px rgba(21, 24, 43, 0.04);
  --shadow-lg: 0 24px 50px -14px rgba(21, 24, 43, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1000px 440px at 12% -12%, rgba(79, 59, 214, 0.065), transparent),
    radial-gradient(760px 380px at 100% 0%, rgba(48, 86, 211, 0.06), transparent),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}

:focus-visible { outline: 2.5px solid rgba(48, 86, 211, 0.55); outline-offset: 2px; }

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 28px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  box-shadow: 0 4px 10px -3px rgba(48, 86, 211, 0.55);
  flex-shrink: 0;
}
.brand-mark .icon { width: 19px; height: 19px; stroke: white; stroke-width: 1.8; }

.brand-text h1 {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.brand-subtitle {
  margin: 1px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  padding: 6px 13px 6px 11px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-unknown { background: #eef0f5; color: var(--muted); }
.status-ok { background: var(--green-bg); color: #117a52; border-color: rgba(26, 156, 107, 0.16); }
.status-error { background: var(--red-bg); color: #a32a30; border-color: rgba(215, 55, 63, 0.16); }

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 372px 1fr;
  align-items: start;
  gap: 22px;
  padding: 26px 28px 48px;
  max-width: 1240px;
  margin: 0 auto;
}

.list-column { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding: 18px 16px 36px; }
  .topbar { padding: 13px 18px; }
}
@media (max-width: 480px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .status-pill { margin-left: 50px; }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 22px 24px;
}

.form-card { position: sticky; top: 88px; }
@media (max-width: 860px) { .form-card { position: static; } }

.card h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.icon-accent { color: var(--blue); width: 17px; height: 17px; }

.count-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--blue-dark);
  background: var(--blue-bg);
  border-radius: 999px;
  padding: 2px 9px;
  margin-left: -2px;
}

/* ---------- Next meeting highlight ---------- */

.next-meeting {
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  background: linear-gradient(120deg, var(--blue) 0%, var(--indigo) 130%);
  box-shadow: 0 14px 28px -12px rgba(48, 86, 211, 0.45);
  color: white;
}
.next-meeting-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 8px;
}
.next-meeting-body { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.next-meeting-topic { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.next-meeting-time {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}
.next-meeting-time .icon { stroke: rgba(255, 255, 255, 0.88); }
.next-meeting-countdown {
  font-size: 12.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Form ---------- */

form label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.field-group { margin-bottom: 2px; }
.field-group label { margin-bottom: 6px; }

form input[type="text"],
form input[type="number"],
form input[type="datetime-local"],
form textarea,
form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  background: #fcfcfe;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

form input::placeholder, form textarea::placeholder { color: var(--muted-light); font-weight: 400; }

form input:hover, form textarea:hover, form select:hover { border-color: #ccd1e0; }

form input:focus, form textarea:focus, form select:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3.5px rgba(48, 86, 211, 0.13);
}

form textarea { resize: vertical; min-height: 44px; }

form .row { display: flex; gap: 12px; }
form .row label { flex: 1; }
form .row label.col-narrow { flex: 0 0 104px; }

form .hint {
  margin: -8px 0 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
}

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0 6px;
  margin-bottom: 6px;
}

form .checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text-secondary);
  padding: 8px 0;
  margin-bottom: 0;
  cursor: pointer;
}
form .checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
  flex-shrink: 0;
  cursor: pointer;
}
form .checkbox:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }

.actions { display: flex; gap: 10px; margin-top: 12px; }

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 600;
  background: var(--blue);
  color: white;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, opacity 0.12s ease, border-color 0.12s ease;
}
button:hover { background: var(--blue-dark); box-shadow: var(--shadow-md); transform: translateY(-1px); }
button:active { transform: translateY(0); box-shadow: var(--shadow-sm); }

button.secondary {
  background: #fff;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
button.secondary .icon { color: var(--muted); }
button.secondary:hover { background: #f7f8fc; border-color: #ccd1e0; box-shadow: none; }

button.danger { background: var(--red); }
button.danger:hover { background: var(--red-dark); }

.hidden { display: none !important; }

.error {
  color: #a32a30;
  background: var(--red-bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 10px;
}
.muted { color: var(--muted); font-size: 14px; }

/* ---------- Meetings list ---------- */

.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.list-header h2 { margin-bottom: 0; }

.meetings-list { margin-top: 16px; display: flex; flex-direction: column; gap: 13px; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 46px 20px;
  color: var(--muted);
}
.empty-state .icon-empty { width: 30px; height: 30px; color: var(--muted-light); margin-bottom: 12px; stroke-width: 1.5; }
.empty-state p { margin: 0; font-size: 13.5px; font-weight: 500; }
.modal-empty { padding: 32px 16px; }

.meeting-item {
  position: relative;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 18px 15px 22px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.meeting-item:hover { box-shadow: var(--shadow-md); border-color: var(--border); }

.meeting-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 999px;
  background: var(--blue);
}
.meeting-item[data-status="cancelled"]::before { background: var(--muted-light); }
.meeting-item[data-status="started"]::before { background: var(--green); }

.meeting-item .meeting-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 11px;
}
.meeting-item h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 18px;
  row-gap: 8px;
}
@media (max-width: 560px) { .meta-grid { grid-template-columns: 1fr; } }

.meta-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  min-width: 0;
}
.meta-row .meta-icon { color: var(--muted-light); flex-shrink: 0; padding-top: 1px; }
.meta-row .meta-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-link { color: var(--blue-dark); font-weight: 600; text-decoration: none; min-width: 0; }
.meta-link:hover { text-decoration: underline; }

.meeting-item .meeting-actions {
  display: flex;
  gap: 6px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.meeting-item .meeting-actions button { font-size: 12px; padding: 7px 11px; }

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--blue-bg);
  color: var(--blue-dark);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.tag.tag-cancelled { background: #f0f1f5; color: var(--muted); }
.tag.tag-whatsapp-on { background: var(--green-bg); color: #117a52; text-transform: none; letter-spacing: 0; font-size: 11.5px; padding: 2px 9px; }
.tag.tag-whatsapp-off { background: #f0f1f5; color: var(--muted-light); text-transform: none; letter-spacing: 0; font-size: 11.5px; padding: 2px 9px; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 19, 36, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
  animation: fade-in 0.15s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 26px;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.18s ease;
}
.modal h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; font-size: 15.5px; font-weight: 700; }
.modal-subtitle { margin: -10px 0 14px; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f1f2f7;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  padding: 7px 11px;
  border-radius: 999px;
  box-shadow: none;
}
.modal-close:hover { background: #e4e6ef; color: var(--text); box-shadow: none; transform: none; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border-light); }
table tr:last-child td { border-bottom: none; }
table a { color: var(--blue-dark); font-weight: 600; text-decoration: none; }
table a:hover { text-decoration: underline; }
