/* ====================================================================
   S.R. PE Group - HDPE Pipe Extrusion & Utility PM System
   Custom UI & Responsive Styling
   ==================================================================== */

:root {
  --primary: #0d47a1;
  --primary-hover: #08306b;
  --secondary: #1976d2;
  --accent: #00897b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0284c7;
  --dark: #1e293b;
  --light: #f8fafc;
  --border: #e2e8f0;
}

body {
  font-family: 'Sarabun', Tahoma, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f1f5f9;
  color: #334155;
  -webkit-tap-highlight-color: transparent;
}

/* Navbar & Brand */
.navbar-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-badge {
  background: linear-gradient(135deg, #0d47a1, #00897b);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

/* App Header Nav */
.top-nav {
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.nav-pill-custom {
  color: #64748b;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-pill-custom:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.nav-pill-custom.active {
  background: #0d47a1;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 71, 161, 0.25);
}

/* KPI Cards */
.kpi-card {
  border-radius: 14px;
  border: none;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
  position: relative;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.kpi-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Checklist Cards & Large Buttons */
.check-item-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.check-item-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 3px 10px rgba(0,0,0,0.03);
}

.status-btn-group .btn {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  min-width: 70px;
}

/* Big Radio Buttons for Overall Machine Status */
.machine-status-option input:checked + label {
  border-width: 2.5px;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.status-normal-label {
  border: 2px solid #86efac;
  background-color: #f0fdf4;
  color: #15803d;
}
.status-normal-label:hover {
  background-color: #dcfce7;
}
.status-warning-label {
  border: 2px solid #fde047;
  background-color: #fefce8;
  color: #a16207;
}
.status-warning-label:hover {
  background-color: #fef9c3;
}
.status-repair-label {
  border: 2px solid #fca5a5;
  background-color: #fef2f2;
  color: #b91c1c;
}
.status-repair-label:hover {
  background-color: #fee2e2;
}

/* Equipment Fleet Table & Badges */
.badge-normal {
  background-color: #dcfce7;
  color: #15803d;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
}
.badge-warning {
  background-color: #fef3c7;
  color: #b45309;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
}
.badge-breakdown {
  background-color: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
}
.badge-maintenance {
  background-color: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
}

/* User Identity Bar */
.user-identity-bar {
  background: linear-gradient(135deg, #1e3a8a, #0369a1);
  color: white;
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
}

/* PIN Numpad */
.pin-pad-btn {
  height: 55px;
  font-size: 1.3rem;
  font-weight: 600;
  border-radius: 10px;
}

/* Responsive utilities */
@media (max-width: 768px) {
  .nav-pill-custom span {
    display: none;
  }
  .nav-pill-custom i {
    font-size: 1.25rem;
    margin: 0;
  }
  .check-item-card {
    padding: 12px;
  }
  .status-btn-group .btn {
    padding: 8px 10px;
    font-size: 0.85rem;
    min-width: 55px;
  }
}

/* Print Styling */
@media print {
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  body {
    background: #ffffff !important;
    font-size: 12pt;
  }
  .card {
    border: 1px solid #000 !important;
    box-shadow: none !important;
  }
}

/* Initial authentication view also works before the application has loaded. */
[hidden] { display: none !important; }
.auth-gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #e8f0ff, #f8fafc); }
.auth-card { width: min(100%, 440px); background: white; border: 1px solid #dbe4f0; border-radius: 20px; box-shadow: 0 20px 70px #0f294d15; padding: 32px; }
.auth-required > header, .auth-required > main { display: none; }
@media (max-width: 600px) { header .d-flex { flex-wrap: wrap; } .auth-card { padding: 24px; } }
@media print { .auth-gate { display: none; } }
