/* service-app — CSS */
:root {
  --bg: #FAF6F0;
  --bg2: #F0E8DA;
  --bg3: #E8DDD0;
  --text: #3D2E1E;
  --text2: #7A6A55;
  --accent: #B07840;
  --accent2: #8B5E30;
  --success: #4A7A4A;
  --danger: #A04040;
  --warn: #C09030;
  --border: #D4C8B8;
  --white: #FFFFFF;
  --shadow: 0 2px 8px rgba(60,40,20,0.12);
  --radius: 10px;
}
[data-theme=dark] {
  --bg: #1E1812;
  --bg2: #2A2318;
  --bg3: #352E22;
  --text: #F0E8DA;
  --text2: #A89880;
  --accent: #C08848;
  --accent2: #D4A060;
  --success: #5A9A5A;
  --danger: #C05050;
  --warn: #D0A030;
  --border: #4A3E30;
  --white: #2A2318;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* FAB — Floating Action Button */
.fab {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #C04848;
  color: #3D2E1E;
  border: none;
  font-size: 32px;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(192,72,72,0.4);
  z-index: 150;
  line-height: 60px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(192,72,72,0.55); }
.fab:active { transform: scale(0.95); }

/* Dark modal overlay */
.modal-overlay-dark {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay-dark.active { display: flex; }

.modal-dark {
  background: #E8DCC8;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 95vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.modal-dark .pull-tab {
  width: 40px;
  height: 4px;
  background: #5A4030;
  border-radius: 2px;
  margin: 12px auto 0;
}
.modal-dark .modal-header-dark {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 12px;
}
.modal-dark .modal-header-dark h2 {
  font-size: 17px;
  color: #B07840;
  font-weight: 600;
}
.modal-dark .modal-body-dark { padding: 8px 20px 20px; }

.modal-dark .form-group-dark { margin-bottom: 14px; }
.modal-dark .form-group-dark label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #7A6A55;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.modal-dark .form-group-dark input,
.modal-dark .form-group-dark select,
.modal-dark .form-group-dark textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #B07840;
  border-radius: 10px;
  background: #E8DCC8;
  color: #3D2E1E;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.modal-dark .form-group-dark input::placeholder,
.modal-dark .form-group-dark textarea::placeholder { color: #9A8A75; }
.modal-dark .form-group-dark input:focus,
.modal-dark .form-group-dark select:focus,
.modal-dark .form-group-dark textarea:focus { border-color: #B07840; }
.modal-dark .form-group-dark select { appearance: none; cursor: pointer; }
.modal-dark .form-group-dark textarea { resize: vertical; min-height: 90px; }
.modal-dark .form-row-dark { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.modal-dark .btn-row {
  display: flex;
  gap: 12px;
  padding: 0 20px 20px;
}
.modal-dark .btn-cancel {
  flex: 1; padding: 14px; border-radius: 10px; border: 1.5px solid #B07840;
  background: transparent; color: #3D2E1E; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.modal-dark .btn-cancel:hover { background: #D4C8B0; }
.modal-dark .btn-save {
  flex: 1; padding: 14px; border-radius: 10px; border: none;
  background: #B07840; color: white; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.modal-dark .btn-save:hover { background: #9A6830; }

[data-theme=dark] .modal-overlay-dark { background: rgba(0,0,0,0.7); }

/* Car detail modal info display */
.cd-info-block {
  background: #E8DCC8;
  border: 1px solid #B07840;
  border-radius: 12px;
  padding: 10px 14px;
}
.cd-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 5px 0;
  border-bottom: 1px solid #1A2E4A;
  gap: 12px;
}
.cd-info-row:last-child { border-bottom: none; }
.cd-label {
  font-size: 11px;
  font-weight: 700;
  color: #7A6A55;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.cd-value {
  font-size: 14px;
  color: #3D2E1E;
  text-align: right;
  word-break: break-all;
}

/* Action buttons area */
.cd-action-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 24px;
  flex-shrink: 0;
}
.cd-action-area { flex-wrap: nowrap !important; overflow: visible; }
@media (min-width: 480px) {
  .cd-col-right-3 { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .cd-col-right-3 .cd-btn { flex: 1; min-width: calc(50% - 4px); }
}
.cd-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.cd-btn-red { background: #C04040; color: #3D2E1E; }
.cd-btn-red:hover { background: #D05050; }
.cd-btn-blue { background: #B07840; color: #3D2E1E; }
.cd-btn-blue:hover { background: #9A6830; }
.cd-btn-green { background: #3A8A4A; color: #3D2E1E; }
.cd-btn-green:hover { background: #449A55; }
.cd-btn-orange { background: #C07820; color: #3D2E1E; display: block; visibility: visible; }
.cd-btn-orange:hover { background: #D08830; }
.cd-btn-orange { background: #C07820; color: #3D2E1E; }
.cd-btn-orange:hover { background: #D08830; }

/* LOGIN */
#login-screen {
  display: flex; align-items: center; justify-content: center; height: 100vh;
  background: var(--bg);
}
.login-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 360px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-box h1 { font-size: 24px; color: var(--accent); margin-bottom: 8px; }
.login-box p { color: var(--text2); font-size: 13px; margin-bottom: 24px; }
.login-box input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text);
  font-size: 15px; margin-bottom: 12px; outline: none;
}
.login-box input:focus { border-color: var(--accent); }
.login-box button {
  width: 100%; padding: 12px; background: var(--accent); color: #3D2E1E;
  border: none; border-radius: 8px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.login-box button:hover { background: var(--accent2); }
.login-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 20px; }

/* APP SHELL */
#app { display: none; height: 100vh; flex-direction: column; }

/* HEADER */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  display: flex; align-items: center; height: 56px;
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 100;
}
.header-title { font-size: 17px; font-weight: 700; color: var(--accent); flex: 1; }
.header-back { background: none; border: none; color: var(--accent); font-size: 20px; cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.header-back:hover { background: var(--bg2); }
.kebab-btn {
  background: none; border: none; color: var(--text2);
  font-size: 22px; cursor: pointer; padding: 6px 10px;
  border-radius: 6px; line-height: 1;
}
.kebab-btn:hover { background: var(--bg2); }

/* NAV TABS */
nav {
  display: flex; background: var(--white); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-tab {
  flex: 1; padding: 10px 8px; text-align: center;
  background: none; border: none; color: var(--text2);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
}
.nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-tab:hover { color: var(--text); }

/* MAIN CONTENT */
main { flex: 1; overflow-y: auto; padding: 16px; }

/* CARDS */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.card-sub { font-size: 13px; color: var(--text2); }

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.18); } .stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-nr { font-size: 32px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* SEARCH BAR */
.search-bar {
  display: flex; gap: 8px; margin-bottom: 16px;
}
  display: flex; gap: 8px; margin-bottom: 16px;
}
.search-barOLD {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.search-bar {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.search-barOLD { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); color: var(--text); font-size: 15px; outline: none; }
.search-bar input:focus { border-color: var(--accent); }
.search-bar .btn { flex-shrink: 0; }

/* OLD - remove duplicate */
.search-bar input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--white); color: var(--text);
  font-size: 15px; outline: none;
}
.search-bar input:focus { border-color: var(--accent); }

/* BUTTONS */
.btn {
  padding: 8px 16px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: #3D2E1E; }
.btn-primary:hover { background: var(--accent2); }
.btn-secondary { background: var(--bg3); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #3D2E1E; }
.btn-danger:hover { opacity: 0.85; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { display: block; width: 100%; }

/* CAR LIST ITEM */
.car-item {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  transition: all 0.15s; box-shadow: var(--shadow);
}
.car-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.car-icon { font-size: 28px; }
.car-info { flex: 1; }
.car-nr { font-size: 16px; font-weight: 700; color: var(--text); }
.car-details { font-size: 13px; color: var(--text2); }
.car-client { font-size: 12px; color: var(--accent); font-weight: 600; }
.car-arrow { color: var(--text2); font-size: 18px; }

/* APPOINTMENT LIST */
.appt-item {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--shadow);
}
.appt-time { font-size: 20px; font-weight: 800; color: var(--accent); min-width: 60px; text-align: center; }
.appt-date { font-size: 11px; color: var(--text2); font-weight: 600; }
.appt-info { flex: 1; }
.appt-nr { font-size: 15px; font-weight: 700; }
.appt-serv { font-size: 13px; color: var(--text2); }
.appt-user { font-size: 11px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.appt-status {
  font-size: 11px; font-weight: 700; padding: 3px 8px;
  border-radius: 20px; text-transform: uppercase;
}
.status-programata { background: #E8F0E8; color: var(--success); }
.status-in_lucru { background: #FFF3E0; color: var(--warn); }
.status-finalizata { background: var(--bg3); color: var(--text2); }
.status-anulata { background: #FAEAEA; color: var(--danger); }

/* INTERVENTION LIST */
.int-item { position: relative; padding-bottom: 40px; 
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
  box-shadow: var(--shadow); position: relative;
}
.int-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.int-date { font-size: 13px; font-weight: 700; color: var(--accent); }
.int-cost { font-size: 15px; font-weight: 800; color: var(--success); margin-left: auto; }
.int-serv { font-size: 14px; font-weight: 600; }
.int-desc { font-size: 13px; color: var(--text2); margin-top: 4px; }
.int-user { font-size: 11px; color: var(--text2); margin-top: 4px; }
.int-pdf { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--accent); text-decoration: none; margin-top: 6px; }
.int-edit-btn {
  position: absolute; bottom: 10px; right: 10px; top: auto;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 8px; font-size: 11px; font-weight: 600;
  color: var(--text2); cursor: pointer;
}
.int-edit-btn:hover { background: var(--accent); color: #3D2E1E; border-color: var(--accent); }

/* MODAL */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white); border-radius: 14px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--white); border-radius: 14px 14px 0 0;
}
.modal-header h2 { font-size: 17px; color: var(--accent); }
.modal-close { background: none; border: none; font-size: 22px; color: var(--text2); cursor: pointer; padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--bg2); }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* FORM */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--text2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.3px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text);
  font-size: 15px; outline: none; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 11px; color: var(--text2); margin-top: 3px; }
.required { color: var(--danger); }

/* KEBAB MENU DROPDOWN */
.kebab-menu {
  position: fixed; top: 60px; right: 10px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
  min-width: 200px; z-index: 300;
  display: none; overflow: hidden;
}
.kebab-menu.active { display: block; }
.km-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; font-size: 14px; font-weight: 600;
  color: var(--text); cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; transition: background 0.1s;
}
.km-item:hover { background: var(--bg2); }
.km-item.danger { color: var(--danger); }
.km-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* USER BADGE */
.user-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text2); font-weight: 600;
}

/* SEARCH RESULT HIGHLIGHT */
.highlight { background: #FFF3D0; padding: 1px 3px; border-radius: 3px; }

/* SECTION TITLE */
.section-title {
  font-size: 13px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text2); margin-bottom: 10px;
}

/* EMPTY STATE */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text2);
}
.empty-state .emoji { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* CAR DETAIL */
.car-detail-header {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.car-detail-nr { font-size: 22px; font-weight: 800; color: var(--accent); }
.car-detail-info { font-size: 13px; color: var(--text2); margin-top: 4px; }
.back-btn {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600;
  color: var(--text2); cursor: pointer; display: inline-flex;
  align-items: center; gap: 6px; margin-bottom: 14px;
}
.back-btn:hover { background: var(--border); }

/* THEME TOGGLE */
.km-theme { justify-content: space-between; }

/* MOBILE */
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { max-height: 95vh; border-radius: 14px 14px 0 0; margin-top: auto; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-overlay-dark { align-items: center; }
  .modal-dark { border-radius: 20px 20px; max-height: 85vh; margin: 0 8px; }
  .fab { bottom: 24px; right: 20px; width: 56px; height: 56px; font-size: 28px; }
}

/* LOGO */
.shop-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; }

/* NOTIFICATION TOAST */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 24px;
  border-radius: 10px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); z-index: 999; white-space: nowrap;
  opacity: 0; transition: opacity 0.3s;
}
.toast.show { opacity: 1; }
.toast.success { background: var(--success); color: #3D2E1E; }
.toast.error { background: var(--danger); color: #3D2E1E; }

/* LOADING */
.loading { text-align: center; padding: 30px; color: var(--text2); font-size: 14px; }

/* Orange button */
.cd-btn-orange { background: #C07820; color: #3D2E1E; }
.cd-btn-orange:hover { background: #D08830; }
.cd-btn-orange { background: #C07820; color: #3D2E1E; }
