/* =====================================================================
   Plataforma de Registo do Parque Informático — Universidade Atlântica
   Design
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Cor - Ajustadas para harmonizar com o azul oficial #0081c9 */
  --navy-deep:   #021F38; /* Um azul escuro mais frio derivado do #0081c9 */
  --navy:        #005A8D; /* Tom intermédio alinhado com a nova paleta */
  --ocean:       #0081C9; /* O teu azul base (fixo) */
  --ocean-light: #52B3E9; /* Uma variação mais clara e viva do teu azul */
  --sand:        #F6F3EC;
  --sand-card:   #FFFFFF;
  --brass:       #C9A227;
  --coral:       #E2572B;
  --teal:        #2A9D8F;
  --ink:         #14212E;
  --ink-soft:    #5A6B7A;
  --line:        #E3DFD3;

  /* Tipografia */
  --font-display: 'Fraunces', serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Layout */
  --sidebar-w: 264px;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(10, 37, 64, 0.08);
  --shadow-lift: 0 10px 30px rgba(10, 37, 64, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy-deep);
  margin: 0 0 6px 0;
}

/* ---------- Onda de assinatura (elemento distintivo) ---------- */
.tide-line {
  width: 100%;
  height: 14px;
  display: block;
  color: var(--brass);
}

/* ---------- Layout geral ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Marca de Água ----------- */
        .marca-agua {
            position: fixed;
            bottom: 10px;
            right: 15px;
            font-size: 11px;
            color: rgba(0, 0, 0, 0.02);
            font-weight: bold;
            letter-spacing: 1px;
            z-index: 9999;
            pointer-events: none;
            font-family: Arial, sans-serif;
        }

/* ---------- Barra lateral ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #E9EEF3;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  padding: 26px 24px 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
}

.sidebar-brand .crest {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--brass);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--brass);
  margin-bottom: 10px;
}

.sidebar-brand .name {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.25;
  color: #fff;
}

.sidebar-brand .sub {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ocean-light);
  margin-top: 4px;
}

.nav-group {
  padding: 18px 12px;
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(233,238,243,0.45);
  padding: 8px 12px 6px 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #D8E1E9;
  margin-bottom: 2px;
  transition: background .15s ease, color .15s ease;
}

.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; }

.nav-link:hover { background: rgba(255,255,255,0.07); color: #fff; }

.nav-link.active {
  background: var(--ocean);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brass);
}

.nav-badge {
  margin-left: auto;
  background: var(--coral);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 24px;
  font-size: 11px;
  color: rgba(233,238,243,0.4);
  border-top: 1px solid rgba(255,255,255,0.09);
}

/* ---------- Conteúdo principal ---------- */
.main {
  flex: 1;
  min-width: 0;
}

.topbar {
  background: var(--sand-card);
  border-bottom: 1px solid var(--line);
  padding: 20px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .eyebrow {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ocean);
  font-weight: 600;
}

.topbar h1 { font-size: 26px; margin: 2px 0 0 0; }

.content { padding: 32px 36px 60px 36px; }

/* ---------- Cartões de estatística ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--sand-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent, var(--ocean));
}

.stat-card .label {
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}

.stat-card .value {
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--navy-deep);
  margin-top: 4px;
}

.stat-card .delta { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Cartões genéricos / painéis ---------- */
.panel {
  background: var(--sand-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 { font-size: 17px; margin: 0; }
.panel-body { padding: 22px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--ocean); color: #fff; }
.btn-primary:hover { background: var(--navy); }

.btn-brass { background: var(--brass); color: var(--navy-deep); }
.btn-brass:hover { filter: brightness(1.05); }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--line);
}
.btn-outline:hover { border-color: var(--ocean); color: var(--ocean); }

.btn-danger { background: #FBEAE5; color: var(--coral); }
.btn-danger:hover { background: var(--coral); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 6px; }

/* ---------- Formulários ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
}
.form-grid .full { grid-column: 1 / -1; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 14px;
  background: #FDFCFA;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ocean);
  box-shadow: 0 0 0 3px rgba(27,111,140,0.15);
}

.field textarea { resize: vertical; min-height: 80px; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data th {
  text-align: left;
  padding: 12px 14px;
  background: #F1EEE4;
  color: var(--navy);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.data tbody tr:hover { background: #FBF9F4; }

.mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--navy); }

/* ---------- Pílulas de estado ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.pill-ativo   { background: #E4F3EF; color: var(--teal); }
.pill-reparacao { background: #FDF3E0; color: #B9840C; }
.pill-fora     { background: #FBEAE5; color: var(--coral); }
.pill-ok       { background: #E4F3EF; color: var(--teal); }
.pill-atencao { background: #FDF3E0; color: #B9840C; }
.pill-critico { background: #FBEAE5; color: var(--coral); }
.pill-neutro  { background: #ECEAE2; color: var(--ink-soft); }

/* ---------- Alertas / lista de notificações ---------- */
.alert-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent, var(--ocean));
  border-radius: 8px;
  margin-bottom: 10px;
  background: #FFFEFC;
}

.alert-item .icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent, var(--ocean));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.alert-item .msg { font-weight: 600; color: var(--navy-deep); font-size: 14px; }
.alert-item .meta { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--ink-soft);
}
.empty svg { width: 46px; height: 46px; color: var(--line); margin-bottom: 12px; }

/* ---------- Mensagens flash ---------- */
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.flash-success { background: #E4F3EF; color: #1E7268; border-color: #BFE4DC; }
.flash-error   { background: #FBEAE5; color: #B03A1D; border-color: #F3C6B7; }

/* ---------- Utilitários ---------- */
.text-muted { color: var(--ink-soft); }
.text-right { text-align: right; }
.flex { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-0 { margin-top: 0; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 20px; }
  .topbar { padding: 16px 20px; }
}
