* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f6fa; color: #2d3436; }

/* Nav */
nav { background: #1a1a2e; color: white; padding: 0 2rem; display: flex; align-items: center; gap: 2rem; height: 56px; }
nav .brand { font-weight: 700; font-size: 1.1rem; color: #e94560; letter-spacing: 0.5px; }
nav a { color: #ccc; text-decoration: none; font-size: 0.9rem; }
nav a:hover { color: white; }
nav .spacer { flex: 1; }
nav .user { font-size: 0.85rem; color: #aaa; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

/* Cards */
.card { background: white; border-radius: 10px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 1.5rem; }
.card h2 { font-size: 1.1rem; margin-bottom: 1rem; color: #1a1a2e; border-bottom: 2px solid #e94560; padding-bottom: 0.5rem; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th { background: #1a1a2e; color: white; padding: 0.7rem 1rem; text-align: left; font-size: 0.85rem; }
td { padding: 0.7rem 1rem; border-bottom: 1px solid #eee; font-size: 0.9rem; }
tr:hover td { background: #f8f9ff; }
.badge { display: inline-block; padding: 0.2rem 0.7rem; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge-draft { background: #ffeaa7; color: #856404; }
.badge-final { background: #d4edda; color: #155724; }
.badge-ok { background: #d4edda; color: #155724; }
.badge-nc { background: #f8d7da; color: #721c24; }
.badge-nr { background: #e2e3e5; color: #383d41; }

/* Buttons */
.btn { display: inline-block; padding: 0.5rem 1.2rem; border-radius: 6px; font-size: 0.9rem; font-weight: 600; cursor: pointer; text-decoration: none; border: none; transition: opacity 0.15s; }
.btn:hover { opacity: 0.85; }
.btn-primary { background: #e94560; color: white; }
.btn-secondary { background: #1a1a2e; color: white; }
.btn-outline { background: transparent; border: 2px solid #1a1a2e; color: #1a1a2e; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.82rem; }
.btn-pdf { background: #e94560; color: white; }

/* Forms */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: 0.85rem; font-weight: 600; color: #555; margin-bottom: 0.3rem; }
input[type=text], input[type=date], textarea, select {
  width: 100%; padding: 0.5rem 0.75rem; border: 1.5px solid #ddd; border-radius: 6px;
  font-size: 0.9rem; font-family: inherit; transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: #e94560; }
textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* Machine block */
.machine-block { background: #f8f9ff; border: 1.5px solid #e0e4f5; border-radius: 8px; padding: 1.2rem; margin-bottom: 1rem; }
.machine-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.machine-title { font-weight: 700; font-size: 1rem; color: #1a1a2e; }
.machine-meta { font-size: 0.82rem; color: #777; }

/* Photos */
.photos-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.photo-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid #ddd; cursor: pointer; }

/* Personnel section */
.tech-section-label {
  font-size: 0.75rem; font-weight: 700; color: #1a6eb5;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 0.5rem;
}
.tech-hint {
  font-size: 0.82rem; color: #888; background: #f0f4ff;
  border-left: 3px solid #1a6eb5; padding: 0.5rem 0.8rem;
  border-radius: 0 6px 6px 0; margin-bottom: 0.8rem;
}
.tech-extra-row { background: #fafafa; border-radius: 6px; padding: 0.5rem; border: 1px solid #eee; margin-bottom: 0.5rem; }

/* Measures geographical grid */
.measures-geo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 0.5rem;
}
.measures-geo-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #888;
  font-style: italic;
  letter-spacing: 0.5px;
}
.measures-geo-grid {
  display: grid;
  gap: 4px;
  background: #e8eaf6;
  border: 2px solid #9fa8da;
  border-radius: 8px;
  padding: 10px;
  width: 100%;
  max-width: 480px;
}
.measure-input {
  width: 100% !important;
  padding: 0.45rem 0.3rem !important;
  text-align: center;
  font-size: 0.95rem !important;
  font-weight: 700;
  border: 1.5px solid #9fa8da !important;
  border-radius: 5px;
  background: white;
  color: #1a1a2e;
  -moz-appearance: textfield;
}
.measure-input::-webkit-outer-spin-button,
.measure-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.measure-input:focus { border-color: #e94560 !important; outline: none; box-shadow: 0 0 0 2px rgba(233,69,96,0.15); }
.measure-empty {
  padding: 0.45rem;
  text-align: center;
  color: #ccc;
  font-size: 0.9rem;
  border: 1.5px dashed #d0d4f0;
  border-radius: 5px;
  background: #f5f5f5;
}

/* Checks table */
.checks-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; font-size: 0.85rem; }
.checks-table th { background: #eef0fb; color: #1a1a2e; padding: 0.4rem 0.6rem; }
.checks-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid #eee; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #1a1a2e; }
.login-box { background: white; border-radius: 12px; padding: 2.5rem; width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.login-box h1 { font-size: 1.5rem; color: #1a1a2e; margin-bottom: 0.3rem; }
.login-box .subtitle { font-size: 0.85rem; color: #aaa; margin-bottom: 1.5rem; }
.login-box .logo { color: #e94560; font-size: 1.8rem; font-weight: 800; margin-bottom: 1rem; }
.alert-error { background: #f8d7da; color: #721c24; padding: 0.7rem 1rem; border-radius: 6px; font-size: 0.88rem; margin-bottom: 1rem; }

/* Alert */
.alert-success { background: #d4edda; color: #155724; padding: 0.7rem 1rem; border-radius: 6px; font-size: 0.88rem; margin-bottom: 1rem; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.toolbar h1 { font-size: 1.4rem; color: #1a1a2e; flex: 1; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: white; border-radius: 10px; padding: 1rem 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-align: center; }
.stat-card .value { font-size: 2rem; font-weight: 700; color: #e94560; }
.stat-card .label { font-size: 0.82rem; color: #777; }

/* Lightbox */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }
.lightbox-close { position: absolute; top: 1rem; right: 1.5rem; color: white; font-size: 2rem; cursor: pointer; }
