/* public/style.css */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f1117;
  --surface:   #181c27;
  --surface2:  #1e2333;
  --border:    #2a3050;
  --accent:    #4f8ef7;
  --accent2:   #7dd3a8;
  --danger:    #e05c6a;
  --text:      #e8ecf4;
  --muted:     #6b7799;
  --radius:    10px;
  --shadow:    0 4px 24px rgba(0,0,0,.45);
}

html { font-size: 15px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Nav ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.nav-brand {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  display: flex; align-items: center; gap: .5rem;
}
.nav-brand span { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-user { color: var(--muted); font-size: .875rem; }
.nav-badge {
  font-family: 'DM Mono', monospace;
  font-size: .7rem;
  padding: .15rem .5rem;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.nav-badge.user { background: var(--accent2); color: #111; }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  border: none;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-success  { background: var(--accent2); color: #111; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-ghost    { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn:hover    { opacity: .85; }
.btn-sm       { padding: .35rem .75rem; font-size: .8rem; }

/* ── Formularios ── */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
label { font-size: .8rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  padding: .6rem .85rem;
  transition: border-color .15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 70px; }

/* ── Card / Panel ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: .5rem;
}

/* ── Tabla ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th {
  text-align: left;
  padding: .6rem .85rem;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-weight: 500;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-family: 'DM Mono', monospace;
}
td {
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* ── Mes selector ── */
.month-nav {
  display: flex; align-items: center; gap: .75rem;
}
.month-label {
  font-family: 'DM Mono', monospace;
  font-size: .9rem;
  min-width: 130px;
  text-align: center;
}

/* ── Alert / Toast ── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 1rem;
}
.alert-error   { background: rgba(224,92,106,.15); border: 1px solid var(--danger); color: #f4a0a8; }
.alert-success { background: rgba(125,211,168,.15); border: 1px solid var(--accent2); color: var(--accent2); }

.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem 1.2rem;
  font-size: .875rem;
  box-shadow: var(--shadow);
  z-index: 9999;
  animation: slideIn .2s ease;
  max-width: 320px;
}
.toast.ok  { border-color: var(--accent2); }
.toast.err { border-color: var(--danger); }
@keyframes slideIn { from { transform: translateY(10px); opacity:0 } to { transform: translateY(0); opacity:1 } }

/* ── Login page ── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.login-card { width: 100%; max-width: 380px; }
.login-title { font-size: 1.5rem; font-weight: 600; margin-bottom: .3rem; }
.login-sub   { color: var(--muted); font-size: .875rem; margin-bottom: 1.8rem; }
.login-form  { display: flex; flex-direction: column; gap: 1rem; }

/* ── Modal ── */
.modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200;
  align-items: center; justify-content: center;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}
.modal-title { font-size: 1rem; font-weight: 600; margin-bottom: 1.2rem; }
.modal-form  { display: flex; flex-direction: column; gap: .9rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }

/* ── Layout principal ── */
.page { padding: 2rem; max-width: 1100px; margin: 0 auto; }
.page-header { margin-bottom: 1.75rem; }
.page-title  { font-size: 1.4rem; font-weight: 600; }
.page-sub    { color: var(--muted); font-size: .875rem; margin-top: .2rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

/* ── Chips de turno ── */
.turno {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: 'DM Mono', monospace;
  font-size: .78rem;
  padding: .2rem .6rem;
  border-radius: 5px;
  background: rgba(79,142,247,.12);
  border: 1px solid rgba(79,142,247,.3);
  color: var(--accent);
}

.empty-state {
  text-align: center;
  padding: 2.5rem;
  color: var(--muted);
  font-size: .875rem;
}
