/* src/styles.css */
:root {
  --cyan: #0e7490;
  --cyan-dark: #0c6680;
  --cyan-light: #0891b2;
  --cyan-faint: #cffafe;
  --bg: #f0f4f8;
  --white: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --sidebar-w: 64px;
  --sidebar-exp: 240px;
  --header-h: 60px;
  --bottom-nav-h:64px;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.06);
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
#root {
  height: 100%;
}
button {
  font-family: inherit;
  cursor: pointer;
}
input,
textarea,
select {
  font-family: inherit;
}
.page-body {
  padding: 20px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.page-header p {
  font-size: 13px;
  color: var(--text-muted);
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-sm {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}
.form-full {
  grid-column: 1 / -1;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #f8fafc;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, .12);
  background: white;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-dim);
}
.field textarea {
  resize: vertical;
  min-height: 80px;
}
.field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-section {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--cyan-faint);
  margin-bottom: 4px;
  grid-column: 1 / -1;
}
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px 10px 36px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text);
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, .1);
}
.filter-select {
  padding: 10px 32px 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 10px center;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}
.filter-select:focus {
  border-color: var(--cyan);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  animation: slideUp 0.2s ease;
}
.modal-lg {
  max-width: 760px;
}
@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: white;
  flex-shrink: 0;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  flex-shrink: 0;
}
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
thead tr {
  background: #f1f5f9;
}
th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  color: var(--text);
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
tbody tr {
  transition: background 0.1s;
}
tbody tr:hover {
  background: #f0f9ff;
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr[style*="cursor:pointer"]:hover,
tbody tr[style*="cursor: pointer"]:hover {
  background: #e0f2fe;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green {
  background: #dcfce7;
  color: #15803d;
}
.badge-red {
  background: #fee2e2;
  color: #b91c1c;
}
.badge-yellow {
  background: #fef9c3;
  color: #a16207;
}
.badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}
.badge-gray {
  background: #f1f5f9;
  color: #475569;
}
.badge-cyan {
  background: #cffafe;
  color: #0e7490;
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover {
  color: var(--cyan);
}
.tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  font-weight: 700;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}
.empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 280px;
}
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.surface2 {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 14px;
}
.info-box {
  background: rgba(14, 116, 144, .06);
  border: 1px solid rgba(14, 116, 144, .2);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}
.warn-box {
  background: rgba(245, 158, 11, .07);
  border: 1px solid rgba(245, 158, 11, .25);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.6;
}
.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s;
}
.btn-icon:hover {
  background: var(--bg);
}
@media (max-width: 768px) {
  .page-body {
    padding: 16px;
  }
  .modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
  }
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal-lg {
    max-width: 100%;
  }
}
.pin-screen {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(32px, env(safe-area-inset-top, 32px)) 20px max(32px, env(safe-area-inset-bottom, 32px));
  background:
    linear-gradient(
      160deg,
      #f0f9ff 0%,
      #e0f2fe 50%,
      #f8fafc 100%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.pin-brand {
  text-align: center;
  margin-bottom: 24px;
}
.pin-logo {
  height: 44px;
  width: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 4px rgba(14, 116, 144, 0.2));
}
.pin-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: -0.3px;
}
.pin-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.pin-version {
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-dim);
}
.user-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 420px;
  width: 100%;
}
.user-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px 12px;
  width: 110px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition:
    transform .15s,
    box-shadow .15s,
    border-color .15s;
  box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
}
.user-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(14, 116, 144, 0.15);
  border-color: var(--cyan);
}
.user-card:active {
  transform: translateY(0);
}
.user-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cyan);
  color: white;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}
.user-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
}
.user-card-role {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
}
.pin-user-avatar {
  width: 64px !important;
  height: 64px !important;
  font-size: 22px !important;
  margin-bottom: 12px;
}
.pin-dots-row {
  display: flex;
  gap: 18px;
  margin: 20px 0 8px;
}
.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--cyan);
  background: transparent;
  transition: background .15s, transform .1s;
}
.pin-dot.filled {
  background: var(--cyan);
  transform: scale(1.1);
}
.pin-error {
  font-size: 13px;
  color: var(--danger);
  font-weight: 600;
  min-height: 20px;
  text-align: center;
}
.pin-hint {
  font-size: 13px;
  color: var(--text-dim);
  min-height: 20px;
  text-align: center;
}
.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 14px;
  margin: 20px 0 16px;
}
.pin-key {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  border: 1.5px solid var(--border);
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition:
    transform .1s,
    background .1s,
    box-shadow .1s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-key:hover {
  background: #f0f9ff;
  box-shadow: 0 4px 12px rgba(14, 116, 144, 0.15);
}
.pin-key:active {
  transform: scale(0.92);
  background: var(--cyan-faint);
}
.pin-key:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.pin-key-back {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
  font-size: 20px;
}
.pin-key-back:hover {
  background: #fee2e2;
}
.pin-change-user {
  background: none;
  border: none;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background .15s;
}
.pin-change-user:hover {
  background: rgba(14, 116, 144, 0.08);
}
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-10px);
  }
  40% {
    transform: translateX(10px);
  }
  60% {
    transform: translateX(-10px);
  }
  80% {
    transform: translateX(10px);
  }
}
.shake {
  animation: shake .5s ease;
}
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--cyan);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .sidebar {
    width: var(--sidebar-exp) !important;
  }
  .sidebar .sidebar-item-label {
    opacity: 1 !important;
    width: auto !important;
  }
  .sidebar .sidebar-group-label {
    opacity: 1 !important;
    height: 28px !important;
    padding: 12px 16px 4px !important;
  }
  .sidebar .sidebar-item {
    justify-content: flex-start !important;
    padding: 0 16px !important;
    gap: 12px !important;
  }
  .sidebar .sidebar-user-info {
    opacity: 1 !important;
    width: auto !important;
  }
  .sidebar .sidebar-logout {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .sidebar .sidebar-bottom {
    padding: 12px 12px 12px 14px !important;
  }
  .sidebar .sidebar-pin-btn {
    display: none !important;
  }
}
@media (max-width: 767px) {
  .sidebar {
    display: none !important;
  }
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--header-h);
  flex-shrink: 0;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-logo-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-logo-img {
  height: 28px;
  width: auto;
  flex-shrink: 0;
  min-width: 28px;
}
.sidebar-pin-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, background .15s;
}
.sidebar-expanded .sidebar-pin-btn {
  opacity: 1;
  pointer-events: auto;
}
.sidebar-pin-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar {
  display: none;
}
.sidebar-group {
  margin-bottom: 4px;
}
.sidebar-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255, 255, 255, 0.45);
  padding: 12px 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  height: 0;
  transition: opacity .2s, height .2s;
}
.sidebar-expanded .sidebar-group-label {
  opacity: 1;
  height: 28px;
  padding: 12px 16px 4px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  height: 44px;
  padding: 0;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 0;
  transition:
    background .15s,
    color .15s,
    padding .22s;
  position: relative;
  white-space: nowrap;
}
.sidebar-expanded .sidebar-item {
  justify-content: flex-start;
  padding: 0 16px;
  gap: 12px;
}
.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}
.sidebar-item.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}
.sidebar-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 28px;
  background: white;
  border-radius: 0 2px 2px 0;
}
.sidebar-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.sidebar-item-label {
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: opacity .2s, width .22s;
}
.sidebar-expanded .sidebar-item-label {
  opacity: 1;
  width: auto;
}
.sidebar-badge {
  margin-left: auto;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
}
.sidebar-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-expanded .sidebar-bottom {
  padding: 12px 12px 12px 14px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}
.sidebar-user-info {
  overflow: hidden;
  opacity: 0;
  width: 0;
  transition: opacity .2s, width .22s;
}
.sidebar-expanded .sidebar-user-info {
  opacity: 1;
  width: auto;
}
.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}
.sidebar-logout {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.sidebar-expanded .sidebar-logout {
  opacity: 1;
  pointer-events: auto;
}
.sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}
.app-shell {
  margin-left: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: -webkit-fill-available;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
@media (min-width: 768px) {
  .app-shell {
    margin-left: var(--sidebar-exp) !important;
    height: 100vh;
  }
}
.mobile-header {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 12px;
  background: white;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.mobile-menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
  border-radius: 8px;
  flex-shrink: 0;
}
.mobile-menu-btn:hover {
  background: var(--bg);
}
.mobile-header-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.mobile-user-badge {
  width: 36px;
  height: 36px;
  background: #cffafe;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .mobile-header {
    display: none !important;
  }
}
.app-header {
  height: var(--header-h);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 16px;
  flex-shrink: 0;
  z-index: 100;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hamburger-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.hamburger-btn:hover {
  background: var(--bg);
  color: var(--text);
}
.desktop-hamburger {
  display: flex;
}
.mobile-hamburger {
  display: none;
}
.header-greeting .hello {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.2;
}
.header-greeting .name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-logo {
  height: 28px;
  width: auto;
  margin-right: 4px;
}
.header-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: background .15s, color .15s;
}
.header-icon-btn:hover {
  background: var(--bg);
  color: var(--cyan);
}
.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}
.header-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cyan);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  cursor: pointer;
  transition: opacity .15s;
}
.header-user-avatar:hover {
  opacity: 0.85;
}
.main-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 calc(var(--bottom-nav-h) + 8px);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.main-scroll::-webkit-scrollbar {
  width: 5px;
}
.main-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.main-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.bottom-nav {
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  background: white;
  border-top: 1px solid var(--border);
  display: none;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 10px;
  transition: color .15s, background .15s;
  position: relative;
  min-width: 60px;
}
.bottom-nav-item.active {
  color: var(--cyan);
}
.bottom-nav-item:hover {
  background: #f0f9ff;
  color: var(--cyan);
}
.bottom-nav-item span:first-child {
  font-size: 20px;
}
.bottom-nav-item span:last-child {
  font-size: 10px;
  font-weight: 500;
}
.bottom-nav-badge {
  position: absolute;
  top: 2px;
  right: 10px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.card-body {
  padding: 16px 20px;
}
.dashboard-wrap {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1400px;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.kpi-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.kpi-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.kpi-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}
.kpi-card.accent {
  background: var(--cyan);
  border-color: var(--cyan-dark);
}
.kpi-card.accent .kpi-label,
.kpi-card.accent .kpi-value,
.kpi-card.accent .kpi-sub {
  color: white;
}
.kpi-card.accent .kpi-label {
  color: rgba(255, 255, 255, 0.75);
}
.kpi-card.accent .kpi-sub {
  color: rgba(255, 255, 255, 0.65);
}
.actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition:
    transform .15s,
    box-shadow .15s,
    border-color .15s;
}
.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 116, 144, 0.15);
  border-color: var(--cyan);
}
.action-icon {
  font-size: 24px;
}
.action-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}
.dashboard-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.erp-table-wrap {
  overflow-x: auto;
}
.erp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.erp-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.erp-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
  vertical-align: middle;
}
.erp-table tr:last-child td {
  border-bottom: none;
}
.erp-table tr:hover td {
  background: #f8fffe;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.status-active {
  background: #d1fae5;
  color: #065f46;
}
.status-warning {
  background: #fef3c7;
  color: #92400e;
}
.status-danger {
  background: #fee2e2;
  color: #991b1b;
}
.status-info {
  background: #dbeafe;
  color: #1e40af;
}
.status-muted {
  background: #f1f5f9;
  color: #475569;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
  }
}
.modal-sheet {
  background: white;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0 0 32px;
}
@media (min-width: 768px) {
  .modal-sheet {
    border-radius: 16px;
    max-width: 580px;
    max-height: 85vh;
  }
}
.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  padding: 4px 20px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.modal-body {
  padding: 20px;
}
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color .15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--cyan);
}
.form-textarea {
  resize: vertical;
  min-height: 80px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--cyan);
  color: white;
}
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-success {
  background: var(--success);
  color: white;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 12.5px;
}
.btn-full {
  width: 100%;
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-secondary:hover {
  background: #e8edf2;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
}
.empty-icon {
  font-size: 48px;
}
.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.empty-sub {
  font-size: 14px;
  color: var(--text-muted);
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.search-input-wrap {
  flex: 1;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 9px 13px 9px 38px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  outline: none;
  transition: border-color .15s, background .15s;
}
.search-input:focus {
  border-color: var(--cyan);
  background: white;
}
.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.page-wrap {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1400px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.obra-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.obra-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 116, 144, 0.12);
}
.obra-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.obra-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
@media (max-width: 767px) {
  .sidebar {
    width: var(--sidebar-exp);
    transform: translateX(-100%);
    z-index: 300;
  }
  .sidebar-mobile-open {
    transform: translateX(0) !important;
  }
  .sidebar-item-label {
    opacity: 1 !important;
    width: auto !important;
  }
  .sidebar-group-label {
    opacity: 1 !important;
    height: 28px !important;
    padding: 12px 16px 4px !important;
  }
  .sidebar-user-info {
    opacity: 1 !important;
    width: auto !important;
  }
  .sidebar-logout {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .sidebar-item {
    justify-content: flex-start !important;
    padding: 0 16px !important;
    gap: 12px !important;
  }
  .sidebar-bottom {
    padding: 12px 12px 12px 14px !important;
  }
  .app-shell {
    margin-left: 0 !important;
  }
  .bottom-nav {
    display: flex;
  }
  .main-scroll {
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 8px);
  }
  .desktop-hamburger {
    display: none !important;
  }
  .mobile-hamburger {
    display: flex !important;
  }
  .pin-keypad {
    grid-template-columns: repeat(3, 68px);
    gap: 12px;
    margin: 14px 0 12px;
  }
  .pin-key {
    width: 68px;
    height: 68px;
    font-size: 22px;
  }
  .pin-dots-row {
    margin: 14px 0 6px;
    gap: 16px;
  }
  .pin-dot {
    width: 16px;
    height: 16px;
  }
  .user-grid {
    gap: 10px;
  }
  .user-card {
    width: 100px;
    padding: 12px 8px 10px;
  }
  .actions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .dashboard-wrap {
    padding: 16px;
    gap: 16px;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .kpi-value {
    font-size: 20px;
  }
}
@media (min-width: 768px) {
  .main-scroll {
    padding-bottom: 20px;
  }
  .bottom-nav {
    display: none !important;
  }
  .mobile-hamburger {
    display: none !important;
  }
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .actions-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .dashboard-two-col {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-wrap {
    padding: 24px;
  }
  .page-wrap {
    padding: 24px;
  }
}
.text-cyan {
  color: var(--cyan);
}
.text-muted {
  color: var(--text-muted);
}
.text-danger {
  color: var(--danger);
}
.text-success {
  color: var(--success);
}
.font-bold {
  font-weight: 700;
}
.font-medium {
  font-weight: 500;
}
.flex {
  display: flex;
}
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.gap-8 {
  gap: 8px;
}
.gap-12 {
  gap: 12px;
}
.mt-8 {
  margin-top: 8px;
}
.mt-16 {
  margin-top: 16px;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 13px;
}
.login-desktop-bg {
  min-height: 100vh;
  background:
    linear-gradient(
      135deg,
      #0c4a6e 0%,
      #0e7490 50%,
      #164e63 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-desktop-panel {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  width: 100%;
  max-width: 860px;
  min-height: 520px;
  overflow: hidden;
}
.login-desktop-brand {
  background:
    linear-gradient(
      160deg,
      #0e7490 0%,
      #0c4a6e 100%);
  color: #fff;
  padding: 48px 40px;
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}
.login-desktop-logo {
  width: 140px;
  filter: brightness(0) invert(1);
}
.login-desktop-tagline {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  opacity: 0.95;
}
.login-desktop-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.login-feat {
  font-size: 14px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 8px;
}
.login-desktop-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}
.login-desktop-form-box {
  width: 100%;
  max-width: 340px;
}
.login-desktop-welcome {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}
.login-desktop-sub {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 32px;
}
.login-desktop-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-desktop-error {
  background: #fee2e2;
  color: #dc2626;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}
.login-desktop-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  margin-top: 4px;
}
.login-desktop-version {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: #94a3b8;
}
.field-password-wrap {
  position: relative;
}
.field-password-wrap .field-input {
  padding-right: 44px;
}
.field-password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.field-password-toggle:hover {
  opacity: 1;
}
.field-hint {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}
.btn.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}
.scanner-drop {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--surface2);
  transition: border-color 0.2s, background 0.2s;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}
.scanner-drop:hover,
.scanner-drop.drag-over {
  border-color: var(--primary);
  background: rgba(14, 116, 144, 0.06);
}
.scanner-drop.has-image {
  padding: 12px;
  border-color: var(--success);
}
.scanner-preview {
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}
.scanner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}
.scanner-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 12px;
}
@media (max-width: 600px) {
  .scanner-btn-group {
    flex-direction: column;
  }
  .scanner-btn-group .btn {
    width: 100%;
  }
}
