/*
 * EWT — assets/css/style.css
 * Theme: #C0392B (red) / #1A1A1A (black)
 */

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --ewt-red:        #C0392B;
  --ewt-red-dark:   #a93226;
  --ewt-red-light:  #e74c3c;
  --ewt-black:      #1A1A1A;
  --ewt-grey-dark:  #2c2c2c;
  --ewt-grey:       #f5f5f5;
  --ewt-border:     #dee2e6;
  --ewt-text:       #212529;
  --ewt-muted:      #6c757d;
}

/* ── Global ─────────────────────────────────────────────────────────────────── */
body {
  background-color: #f0f0f0;
  color: var(--ewt-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main.container-fluid { flex: 1; }

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.ewt-navbar {
  background-color: var(--ewt-black);
  border-bottom: 3px solid var(--ewt-red);
  padding: .5rem 1rem;
}
.ewt-navbar .navbar-toggler-icon { filter: invert(1); }
.ewt-brand { color: var(--ewt-red) !important; font-weight: 700; font-size: 1.1rem; }
.ewt-brand:hover { color: var(--ewt-red-light) !important; }
.ewt-navbar .nav-link {
  color: #d0d0d0 !important;
  font-size: .9rem;
  padding: .6rem .75rem !important;
  border-radius: 4px;
  transition: background .15s, color .15s;
}
.ewt-navbar .nav-link:hover,
.ewt-navbar .nav-link:focus { color: #fff !important; background-color: rgba(192,57,43,.25); }
.ewt-navbar .dropdown-menu { background-color: var(--ewt-grey-dark); border: 1px solid rgba(255,255,255,.1); }
.ewt-navbar .dropdown-menu .dropdown-item { color: #d0d0d0; font-size: .875rem; }
.ewt-navbar .dropdown-menu .dropdown-item:hover { background-color: var(--ewt-red); color: #fff; }
.ewt-navbar .dropdown-divider { border-color: rgba(255,255,255,.15); }
.ewt-user-menu { font-size: .875rem; }

/* ── Login ──────────────────────────────────────────────────────────────────── */
.ewt-login-bg {
  background: linear-gradient(135deg, var(--ewt-black) 0%, #2c2c2c 50%, #3a3a3a 100%);
  min-height: 100vh;
}
.ewt-login-logo {
  width: 72px; height: 72px; background: var(--ewt-red); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #fff; margin-bottom: .5rem;
  box-shadow: 0 4px 16px rgba(192,57,43,.4);
}
.ewt-login-appname { color: #fff; font-size: 1.3rem; font-weight: 600; }
.ewt-login-card { border: none; border-radius: 8px; }
.ewt-login-card .card-footer { background: transparent; border-top: 1px solid var(--ewt-border); }
.ewt-link { color: var(--ewt-red); text-decoration: none; }
.ewt-link:hover { color: var(--ewt-red-dark); text-decoration: underline; }

/* ── Card headers ────────────────────────────────────────────────────────────── */
.ewt-card-header {
  background-color: var(--ewt-black); color: #fff;
  border-bottom: 2px solid var(--ewt-red);
  font-size: .9rem; font-weight: 600;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.ewt-btn-primary { background-color: var(--ewt-red); border-color: var(--ewt-red); color: #fff; }
.ewt-btn-primary:hover, .ewt-btn-primary:focus { background-color: var(--ewt-red-dark); border-color: var(--ewt-red-dark); color: #fff; }
.ewt-btn-primary:disabled { background-color: #c9786e; border-color: #c9786e; }

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.ewt-badge-active   { background-color: #198754 !important; color: #fff; }
.ewt-badge-paused   { background-color: #fd7e14 !important; color: #fff; }
.ewt-badge-inactive { background-color: #6c757d !important; color: #fff; }
.ewt-badge-pending  { background-color: #0d6efd !important; color: #fff; }
.ewt-badge-coord    { background-color: #6f42c1 !important; color: #fff; font-size: .7rem; }
.ewt-badge-admin    { background-color: var(--ewt-red) !important; color: #fff; font-size: .7rem; }
.ewt-badge-sa       { background-color: var(--ewt-black) !important; color: #fff; font-size: .7rem; }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.ewt-table thead th {
  background-color: var(--ewt-black); color: #fff;
  font-size: .82rem; font-weight: 600; letter-spacing: .03em;
  border-color: #444; white-space: nowrap;
}
.ewt-table tbody td { font-size: .875rem; vertical-align: middle; }
.ewt-actions { white-space: nowrap; width: 1%; }

/* ── Stat cards ──────────────────────────────────────────────────────────────── */
.ewt-stat-card { border: none; border-radius: 8px; border-left: 4px solid var(--ewt-red); box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.ewt-stat-card.ewt-stat-alert { border-left-color: #fd7e14; background: #fff8f0; }
.ewt-stat-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.bg-red-soft  { background: rgba(192,57,43,.12); color: var(--ewt-red); }
.bg-dark-soft { background: rgba(26,26,26,.10);  color: var(--ewt-black); }
.ewt-stat-number { font-size: 1.8rem; font-weight: 700; line-height: 1.1; color: var(--ewt-black); }
.ewt-stat-label  { font-size: .78rem; color: var(--ewt-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ── Page titles ─────────────────────────────────────────────────────────────── */
.ewt-page-title { font-size: 1.4rem; font-weight: 700; color: var(--ewt-black); border-left: 4px solid var(--ewt-red); padding-left: .6rem; }

/* ── Duration display ────────────────────────────────────────────────────────── */
.ewt-duration-display { font-size: 1.1rem; color: var(--ewt-red); }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.ewt-footer { background-color: var(--ewt-black); border-top: 2px solid var(--ewt-red); color: #888; }

/* ── Nav tabs ────────────────────────────────────────────────────────────────── */
.nav-tabs .nav-link.active { border-bottom-color: var(--ewt-red); border-top-color: var(--ewt-red); color: var(--ewt-red); font-weight: 600; }
.nav-tabs .nav-link { color: var(--ewt-muted); }
.nav-tabs .nav-link:hover { color: var(--ewt-red); }

/* ── Pagination ──────────────────────────────────────────────────────────────── */
.page-item.active .page-link { background-color: var(--ewt-red); border-color: var(--ewt-red); }
.page-link { color: var(--ewt-red); }
.page-link:hover { color: var(--ewt-red-dark); }

/* ── Org logo ────────────────────────────────────────────────────────────────── */
.ewt-org-thumb { width:48px; height:48px; object-fit:contain; border-radius:4px; border:1px solid #dee2e6; padding:2px; }
.ewt-logo-placeholder { width:48px; height:48px; display:flex; align-items:center; justify-content:center; background:#f5f5f5; border-radius:4px; border:1px solid #dee2e6; font-size:1.4rem; }
.ewt-logo-preview { max-width:160px; max-height:160px; object-fit:contain; border:2px solid #dee2e6; border-radius:8px; padding:6px; background:#fff; }
.ewt-logo-empty { width:120px; height:120px; background:#f5f5f5; border:2px dashed #ccc; border-radius:8px; display:flex; flex-direction:column; align-items:center; justify-content:center; color:#aaa; font-size:2rem; margin:0 auto; }

/* ── PWA Install button ──────────────────────────────────────────────────────── */
.ewt-btn-install {
  background: transparent; border: 1px solid rgba(192,57,43,.7);
  color: #fff; font-size: .82rem; padding: 4px 12px; border-radius: 4px;
  transition: background .15s, border-color .15s;
}
.ewt-btn-install:hover { background: var(--ewt-red); border-color: var(--ewt-red); color: #fff; }

/* ── Standalone PWA ──────────────────────────────────────────────────────────── */
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); }
  .ewt-navbar { padding-top: calc(.5rem + env(safe-area-inset-top)); }
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ewt-page-title  { font-size: 1.15rem; }
  .ewt-stat-number { font-size: 1.4rem; }
  .ewt-table tbody td, .ewt-table thead th { font-size: .8rem; }
}
@media (max-width: 576px) {
  .ewt-actions .btn { min-width: 36px; min-height: 36px; }
}
