/* ---------------------------------------------------------------
   Design tokens — derived from the Aroca logo (navy wordmark,
   teal-to-green flame, cyan wave underline).
--------------------------------------------------------------- */
:root {
  --ink: #15304C;
  --ink-soft: #52697D;
  --surface: #F1F6F5;
  --card: #FFFFFF;
  --line: #E1EAE8;

  --teal: #0E8C82;
  --teal-deep: #0A6D65;
  --teal-tint: #E3F3F1;

  --sky: #2AA4D8;
  --sky-deep: #1D82AF;
  --sky-tint: #E4F4FA;

  --amber: #DB9A34;
  --amber-deep: #B67A1C;
  --amber-tint: #FBF0DD;

  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-tile: 0 2px 10px rgba(21, 48, 76, 0.07);
  --shadow-tile-hover: 0 6px 18px rgba(21, 48, 76, 0.12);
}

body {
  background: var(--surface);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h1, h2, h3, h4,
.brand-font {
  font-family: 'Manrope', 'Inter', sans-serif;
}

/* ---------------------------------------------------------------
   Signature: a thin wave rule, echoing the swoosh under the logo.
   Used under section headings to tie the whole app back to the
   brand mark instead of a plain Bootstrap <hr>.
--------------------------------------------------------------- */
.wave-rule {
  width: 56px;
  height: 8px;
  margin-top: 4px;
  background-repeat: repeat-x;
  background-size: 16px 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8' viewBox='0 0 16 8'%3E%3Cpath d='M0 4 Q 4 0 8 4 T 16 4' fill='none' stroke='%230E8C82' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.section-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 1rem;
}

.section-title h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

/* Title + trailing action button, wrapping cleanly on mobile */
.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: 1.1rem;
}

.page-header .section-title {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------
   Brand buttons — used outside .form-card, where a plain
   Bootstrap .btn-primary would stay default blue.
--------------------------------------------------------------- */
.btn-teal {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.btn-teal:hover,
.btn-teal:focus-visible {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
  color: #fff;
}

/* ---------------------------------------------------------------
   Stat cards — e.g. vacation day counters
--------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
  margin-bottom: 1.6rem;
}

@media (min-width: 576px) {
  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-tile);
  padding: 1.1rem 1.25rem;
  text-align: center;
}

.stat-card__label {
  color: var(--ink-soft);
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .25rem;
}

.stat-card__value {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  color: var(--tile-accent, var(--teal-deep));
}

.stat-card--available { --tile-accent: var(--teal-deep); }
.stat-card--used       { --tile-accent: var(--amber-deep); }
.stat-card--remaining  { --tile-accent: var(--sky-deep); }
.stat-card--low        { --tile-accent: #C0392B; }

/* ---------------------------------------------------------------
   Table card — clean rounded wrapper for data tables
--------------------------------------------------------------- */
.table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-tile);
  overflow: hidden;
}

.table-card table {
  margin-bottom: 0;
}

.table-card thead th {
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table-card tbody td {
  border-bottom: 1px solid var(--line);
  border-top: none !important;
  vertical-align: middle;
}

.table-card tbody tr:last-child td {
  border-bottom: none;
}

.table-card tbody tr:hover {
  background: var(--surface);
}

/* ---------------------------------------------------------------
   Communications list
--------------------------------------------------------------- */
.comm-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.comm-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius-md);
  padding: .85rem 1rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-tile);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.comm-item:hover,
.comm-item:focus-visible {
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-tile-hover);
}

.comm-item--unread {
  border-left-color: var(--teal);
}

.comm-item__subject {
  font-weight: 600;
}

.comm-item--unread .comm-item__subject {
  font-weight: 800;
}

.comm-item__date {
  color: var(--ink-soft);
  font-size: .82rem;
}

.comm-item__badges {
  display: flex;
  gap: .35rem;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------
   Dashboard header
--------------------------------------------------------------- */
.dash-header {
  padding: 1.25rem 0 .25rem;
}

.dash-header .greeting {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
}

.dash-header .today {
  color: var(--ink-soft);
  font-size: .92rem;
  margin: 2px 0 0;
}

/* ---------------------------------------------------------------
   Action tiles — the three entry points a worker uses every day.
   Full-width, thumb-sized tap targets, one clear job each.
--------------------------------------------------------------- */
.action-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
  margin: 1.1rem 0 1.6rem;
}

@media (min-width: 576px) {
  .action-tiles {
    grid-template-columns: repeat(3, 1fr);
  }
}

.action-tile {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-tile);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.action-tile:hover,
.action-tile:focus-visible {
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-tile-hover);
}

.action-tile:active {
  transform: translateY(0) scale(.99);
}

.action-tile:focus-visible {
  outline: 2px solid var(--tile-accent, var(--teal));
  outline-offset: 2px;
}

.action-tile__icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tile-tint, var(--teal-tint));
  color: var(--tile-accent, var(--teal));
}

.action-tile__icon svg {
  width: 24px;
  height: 24px;
}

.action-tile__body {
  flex: 1 1 auto;
  min-width: 0;
}

.action-tile__title {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.2;
}

.action-tile__subtitle {
  color: var(--ink-soft);
  font-size: .84rem;
  line-height: 1.3;
}

.action-tile__chevron {
  flex: 0 0 auto;
  color: var(--line);
  transition: transform .15s ease, color .15s ease;
}

.action-tile:hover .action-tile__chevron {
  color: var(--tile-accent, var(--teal));
  transform: translateX(2px);
}

.action-tile--work    { --tile-accent: var(--teal-deep);  --tile-tint: var(--teal-tint); }
.action-tile--material{ --tile-accent: var(--amber-deep); --tile-tint: var(--amber-tint); }
.action-tile--vacation{ --tile-accent: var(--sky-deep);   --tile-tint: var(--sky-tint); }

/* ---------------------------------------------------------------
   Special jobs week card — restyled to match the token system,
   same structure/logic as before.
--------------------------------------------------------------- */
.week-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-tile);
}

.week-card__header {
  background: var(--ink);
  color: #fff;
  padding: .85rem 1rem;
}

.week-card__nav-btn {
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 1.1rem;
}

.week-card__nav-btn:hover { background: rgba(255,255,255,.22); color: #fff; }

.week-day {
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--line);
}

.week-day:last-child { border-bottom: none; }

.week-day--today { background: var(--teal-tint); }

.week-day__label {
  min-width: 3.4rem;
  font-family: 'Manrope', 'Inter', sans-serif;
}

.week-day__num { color: var(--ink-soft); font-size: .82rem; }

.job-chip {
  border-radius: var(--radius-md);
  text-decoration: none;
}

/* ---------------------------------------------------------------
   Simple forms (material report, work report) — mobile-first
--------------------------------------------------------------- */
.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-tile);
}

.form-card .btn-primary {
  background: var(--teal);
  border-color: var(--teal);
}
.form-card .btn-primary:hover,
.form-card .btn-primary:disabled {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
}

.form-card--material .btn-warning {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
}
.form-card--material .btn-warning:hover {
  background: var(--amber-deep);
  border-color: var(--amber-deep);
  color: #fff;
}

/* ---------------------------------------------------------------
   Firma táctil — lienzo para dibujar la firma con el dedo
--------------------------------------------------------------- */
.signature-pad-wrapper {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  touch-action: none;
}

.signature-canvas {
  display: block;
  width: 100%;
  height: 180px;
  cursor: crosshair;
}

.signature-preview {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  padding: .5rem;
}

.signature-preview--sm {
  max-width: 160px;
}
