/* ── Meetings tab ─────────────────────────────────────────────────────────── */
#meetings-view { padding: 0 0 32px; }

.mtg-wrap { padding: 0; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.mtg-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px 10px;
}
.mtg-hdr-left {}
.mtg-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.mtg-sub   { font-size: 12px; color: var(--text4); display: block; margin-top: 2px; }
.mtg-hdr-actions { display: flex; gap: 8px; align-items: center; }

.mtg-btn-new {
  background: var(--accent); border: none; border-radius: 8px;
  color: #fff; cursor: pointer; font-size: 13px; font-weight: 600;
  padding: 7px 16px; transition: background .12s;
}
.mtg-btn-new:hover { background: var(--accent-hover, #4f46e5); }

.mtg-btn-refresh {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text3); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 6px 10px;
  transition: all .12s;
}
.mtg-btn-refresh:hover { border-color: var(--accent); color: var(--accent); }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.mtg-filter-bar {
  display: flex; gap: 8px; padding: 0 24px 12px;
  align-items: center; flex-wrap: wrap;
  border-bottom: 1px solid var(--border2);
}
.mtg-search {
  flex: 1; min-width: 180px; padding: 6px 12px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px;
}
.mtg-search:focus { outline: none; border-color: var(--accent); }
.mtg-select {
  padding: 6px 10px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 12px; cursor: pointer;
}

/* ── Meeting list ────────────────────────────────────────────────────────── */
.mtg-list { padding: 12px 24px 24px; display: flex; flex-direction: column; gap: 8px; }
.mtg-loading, .mtg-empty { color: var(--text4); font-size: 13px; padding: 32px 0; text-align: center; }

.mtg-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
  border-left: 3px solid var(--border);
}
.mtg-card:hover  { border-color: var(--accent); }
.mtg-card-active { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent); }

.mtg-card-top {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px;
}
.mtg-card-date  { font-size: 11px; color: var(--text4); font-variant-numeric: tabular-nums; }
.mtg-card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.mtg-card-meta  { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mtg-card-client { font-size: 12px; color: var(--text3); }
.mtg-card-chip  {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text4); font-size: 11px;
  padding: 1px 8px;
}
.mtg-card-ticket {
  font-size: 11px; color: var(--accent); text-decoration: none; margin-left: auto;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 12px; padding: 1px 8px;
}
.mtg-card-ticket:hover { text-decoration: underline; }

/* ── Status chips ────────────────────────────────────────────────────────── */
.mtg-status-chip {
  border-radius: 12px; font-size: 10px; font-weight: 700;
  letter-spacing: .04em; padding: 2px 8px; text-transform: uppercase;
}
.mtg-status-draft       { background: var(--bg3); color: var(--text4); border: 1px solid var(--border); }
.mtg-status-submitting  { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.mtg-status-submitted   { background: #d1fae5; color: #065f46; border: 1px solid #34d399; }

/* ── Right-side panel ────────────────────────────────────────────────────── */
.mtg-panel {
  position: fixed;
  top: 56px;                        /* always below the 56px nav header */
  right: 0;
  width: 480px;
  max-width: 100vw;
  height: calc(100dvh - 56px);
  background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 400;
  overflow: hidden;
}
.mtg-panel.mtg-panel-open { transform: translateX(0); }

.mtg-panel-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mtg-panel-title { font-size: 15px; font-weight: 700; color: var(--text); }
.mtg-panel-close {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 4px 6px; border-radius: 4px;
  transition: color .1s;
}
.mtg-panel-close:hover { color: var(--text); }

.mtg-panel-body {
  flex: 1; overflow-y: auto; padding: 0 0 8px;
}

.mtg-panel-footer {
  border-top: 1px solid var(--border); padding: 12px 20px; flex-shrink: 0;
}
.mtg-footer-row { display: flex; gap: 8px; align-items: center; }
.mtg-footer-submitted { justify-content: center; }
.mtg-footer-status { font-size: 13px; color: #065f46; font-weight: 600; }

/* Shift the main content left when panel is open */
body.mtg-panel-open .main { padding-right: 480px; transition: padding-right .22s ease; }

/* ── Backdrop ────────────────────────────────────────────────────────────── */
.mtg-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  z-index: 399; display: none; opacity: 0; transition: opacity .22s ease;
}
.mtg-backdrop.mtg-backdrop-open { display: block; opacity: 1; }

/* ── Form sections ───────────────────────────────────────────────────────── */
.mtg-section {
  padding: 16px 20px 8px;
  border-bottom: 1px solid var(--border2);
}
.mtg-section:last-child { border-bottom: none; }
.mtg-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text4); margin-bottom: 10px;
}

.mtg-field-row { margin-bottom: 10px; }
.mtg-field-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.mtg-label { font-size: 11px; font-weight: 600; color: var(--text3); display: block; margin-bottom: 4px; }

.mtg-input {
  width: 100%; box-sizing: border-box;
  padding: 7px 10px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 13px;
}
.mtg-input:focus { outline: none; border-color: var(--accent); }
.mtg-input:disabled { opacity: .55; cursor: not-allowed; }

.mtg-textarea {
  width: 100%; box-sizing: border-box;
  padding: 10px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 13px; line-height: 1.6;
  min-height: 180px; resize: vertical; font-family: inherit;
}
.mtg-textarea:focus { outline: none; border-color: var(--accent); }
.mtg-textarea:disabled { opacity: .55; cursor: not-allowed; }

/* ── File attachments ────────────────────────────────────────────────────── */
.mtg-files-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.mtg-no-files   { font-size: 12px; color: var(--text4); padding: 4px 0; }

.mtg-file-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 7px; padding: 7px 10px;
}
.mtg-file-thumb {
  width: 40px; height: 40px; object-fit: cover; border-radius: 4px;
  cursor: pointer; flex-shrink: 0;
}
.mtg-file-icon { font-size: 22px; flex-shrink: 0; width: 40px; text-align: center; }
.mtg-file-info { flex: 1; min-width: 0; }
.mtg-file-name { font-size: 12px; font-weight: 500; color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtg-file-size { font-size: 11px; color: var(--text4); }
.mtg-file-del  {
  background: none; border: none; color: var(--text4);
  cursor: pointer; font-size: 14px; padding: 2px 6px;
  flex-shrink: 0; border-radius: 4px; transition: color .1s;
}
.mtg-file-del:hover { color: #ef4444; }

.mtg-upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text3); cursor: pointer;
  font-size: 12px; font-weight: 500; padding: 6px 12px;
  transition: all .12s; margin-bottom: 8px;
}
.mtg-upload-btn:hover { border-color: var(--accent); color: var(--accent); }

.mtg-drop-zone {
  border: 2px dashed var(--border); border-radius: 8px;
  color: var(--text4); font-size: 12px; padding: 14px;
  text-align: center; transition: all .15s;
}
.mtg-drop-zone.mtg-drop-hover {
  border-color: var(--accent); color: var(--accent); background: var(--bg2);
}

/* ── Contacts ────────────────────────────────────────────────────────────── */
.mtg-contacts-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.mtg-no-contacts   { font-size: 12px; color: var(--text4); padding: 4px 0; }

.mtg-contact-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px;
}
.mtg-contact-name  { font-size: 13px; color: var(--text); font-weight: 500; }
.mtg-contact-email { font-size: 11px; color: var(--text4); margin-left: auto; }

.mtg-contact-search-wrap {}
.mtg-contact-results {
  /* Inline — not a dropdown — avoids clipping by panel overflow */
  margin-top: 4px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 200px; overflow-y: auto;
}
.mtg-cr-item {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 12px; cursor: pointer; transition: background .1s;
}
.mtg-cr-item:hover { background: var(--bg3); }
.mtg-cr-name  { font-size: 13px; color: var(--text); font-weight: 500; }
.mtg-cr-email { font-size: 11px; color: var(--text4); }
.mtg-cr-empty { font-size: 12px; color: var(--text4); padding: 12px; text-align: center; }


/* ── Buttons ─────────────────────────────────────────────────────────────── */
.mtg-btn-save {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 7px 14px; transition: all .12s;
}
.mtg-btn-save:hover { border-color: var(--accent); color: var(--accent); }

.mtg-btn-delete {
  background: none; border: 1px solid var(--border);
  border-radius: 7px; color: var(--text4); cursor: pointer;
  font-size: 12px; padding: 7px 12px; transition: all .12s;
}
.mtg-btn-delete:hover { border-color: #ef4444; color: #ef4444; }

.mtg-btn-submit {
  background: var(--accent); border: none; border-radius: 7px;
  color: #fff; cursor: pointer; font-size: 13px; font-weight: 700;
  padding: 7px 16px; margin-left: auto; transition: background .12s;
}
.mtg-btn-submit:hover { background: var(--accent-hover, #4f46e5); }

.mtg-btn-sm {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text3); cursor: pointer;
  font-size: 12px; padding: 6px 10px; white-space: nowrap;
  transition: all .12s; flex-shrink: 0;
}
.mtg-btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* ── Result bar (ticket link + SharePoint after submit) ──────────────────── */
.mtg-result-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; margin: 12px 20px 0; padding: 10px 14px;
}
.mtg-submitting-bar { color: var(--text4); font-size: 13px; }
.mtg-result-link {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; color: var(--accent); font-size: 12px;
  font-weight: 600; padding: 4px 10px; text-decoration: none;
  transition: border-color .1s;
}
.mtg-result-link:hover { border-color: var(--accent); text-decoration: underline; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
@keyframes mtg-spin { to { transform: rotate(360deg); } }
.mtg-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; display: inline-block;
  animation: mtg-spin .7s linear infinite;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .mtg-panel { width: 100%; }
  body.mtg-panel-open .main { padding-right: 0; }
  .mtg-field-row-2col { grid-template-columns: 1fr; }
  .mtg-ic-add-row { flex-wrap: wrap; }
}
