/* EDURE Password Vault — app.css
   Tema navy #1B3A6B, igual accounting. */

:root {
  --navy:        #1B3A6B;
  --navy-dark:   #122549;
  --navy-light:  #2A5599;
  --bg:          #f5f7fa;
  --card:        #ffffff;
  --text:        #1a1f2e;
  --text-muted:  #6b7280;
  --border:      #d8dde6;
  --danger:      #b91c1c;
  --danger-bg:   #fef2f2;
  --success:     #15803d;
  --warning:     #b45309;
  --warning-bg:  #fef3c7;
  --radius:      8px;
  --shadow:      0 2px 8px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

.hidden { display: none !important; }

.view { min-height: 100vh; }

.brand-accent { color: var(--navy-light); font-weight: 600; }

/* ── Login ────────────────────────────────────────────────────────── */

#view-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
}

.login-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 22px;
}

.login-card .subtitle {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 13px;
}

.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.login-card .version { margin: 16px 0 0; text-align: center; color: var(--text-muted); font-size: 11px; }
.login-card .link { font-size: 12px; color: var(--navy-light); text-decoration: none; align-self: center; margin-top: 4px; }
.login-card .link:hover { text-decoration: underline; }

/* ── Inputs ───────────────────────────────────────────────────────── */

input, textarea, select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(42,85,153,.15);
}

textarea { resize: vertical; min-height: 60px; }

/* ── Buttons ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, border-color .12s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

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

.btn.secondary {
  background: #fff;
  color: var(--navy);
  border-color: var(--navy);
}
.btn.secondary:hover { background: #eef2f8; }

.btn.ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn.ghost:hover { background: #eef0f4; color: var(--text); }

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

.btn.tiny { padding: 4px 8px; font-size: 12px; }

/* ── App: topbar + main ───────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand { font-size: 16px; font-weight: 600; }
.topbar .brand-accent { color: #c0d3ec; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar .user-email { font-size: 12px; opacity: .85; }
.topbar .btn.ghost { color: #fff; }
.topbar .btn.ghost:hover { background: rgba(255,255,255,.12); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.toolbar input[type="search"] {
  flex: 1;
  max-width: 460px;
}

/* ── Tabela ───────────────────────────────────────────────────────── */

table.entries {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.entries th {
  text-align: left;
  background: #eef2f8;
  color: var(--navy-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .03em;
}
table.entries td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  word-break: break-word;
}
table.entries tr:last-child td { border-bottom: 0; }
table.entries td.empty { text-align: center; color: var(--text-muted); padding: 40px; }

.actions-col { width: 1%; white-space: nowrap; }
.row-actions { display: flex; gap: 4px; }

.pwd-mask  { letter-spacing: 2px; color: var(--text-muted); font-family: ui-monospace, monospace; }
.pwd-shown { font-family: ui-monospace, monospace; background: var(--warning-bg); padding: 2px 6px; border-radius: 4px; }

.url-cell a { color: var(--navy-light); text-decoration: none; }
.url-cell a:hover { text-decoration: underline; }

.obs-cell  { max-width: 260px; color: var(--text-muted); font-size: 12px; }

/* ── Modal ────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.modal-card h2 { margin: 0 0 16px; color: var(--navy); font-size: 18px; }
.modal-card form { display: flex; flex-direction: column; gap: 12px; }
.modal-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

.pwd-row { display: flex; gap: 4px; }
.pwd-row input { flex: 1; }

.hint { color: var(--text-muted); font-size: 11px; font-weight: normal; }

/* ── Feedback ─────────────────────────────────────────────────────── */

.error { color: var(--danger); background: var(--danger-bg); padding: 8px 12px; border-radius: 6px; font-size: 13px; }
.info  { color: var(--navy);   background: #eef2f8;          padding: 8px 12px; border-radius: 6px; font-size: 13px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy-dark);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  z-index: 200;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }

/* ── Mobile ───────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .container { padding: 12px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar input[type="search"] { max-width: none; }
  table.entries th:nth-child(4),
  table.entries td:nth-child(4),
  table.entries th:nth-child(5),
  table.entries td:nth-child(5),
  table.entries th:nth-child(6),
  table.entries td:nth-child(6) { display: none; }
}
