@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --emt-primary: #C4622D;
  --emt-dark: #1A1A1A;
  --emt-cream: #F5F0EB;
  --emt-light: #FAF7F4;
  --emt-border: #E8E0D8;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--emt-light);
  color: var(--emt-dark);
  margin: 0;
  padding: 0;
}

/* NAV */
.emt-nav {
  background: #faf7f2;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-bottom: 1px solid var(--emt-border);
}

.emt-nav-logo {
  height: 36px;
  margin-right: 24px;
}

.nav-link {
  color: #555;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--emt-dark); background: rgba(0,0,0,0.06); }
.nav-active { color: #fff !important; background: var(--emt-primary) !important; }

.nav-spacer { flex: 1; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--emt-dark);
  font-size: 14px;
  font-weight: 500;
}
.nav-user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--emt-primary);
}

/* CARDS */
.emt-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--emt-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  padding: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--emt-border);
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--emt-dark);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
  font-weight: 500;
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--emt-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--emt-primary);
  color: #fff;
}
.btn-primary:hover { background: #a8521f; }

.btn-secondary {
  background: #fff;
  color: var(--emt-dark);
  border: 1px solid var(--emt-border);
}
.btn-secondary:hover { background: var(--emt-cream); }

.btn-success {
  background: #22c55e;
  color: #fff;
}
.btn-success:hover { background: #16a34a; }

.btn-danger {
  background: #ef4444;
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* FORMS */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--emt-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--emt-dark);
  background: #fff;
  transition: border-color 0.15s;
  outline: none;
}
.form-control:focus { border-color: var(--emt-primary); box-shadow: 0 0 0 3px rgba(196,98,45,0.1); }
.form-control:disabled { background: #f5f5f5; color: #888; }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* TABLES */
.emt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.emt-table th {
  background: var(--emt-cream);
  color: #555;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--emt-border);
}
.emt-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0ebe5;
  color: var(--emt-dark);
  vertical-align: middle;
}
.emt-table tr:hover td { background: #fdf9f6; }
.emt-table tr:last-child td { border-bottom: none; }

/* SECTION TITLE */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--emt-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--emt-primary);
  border-radius: 2px;
}

/* PAGE HEADER */
.page-header {
  background: #fff;
  border-bottom: 1px solid var(--emt-border);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--emt-dark);
}
.page-subtitle {
  font-size: 13px;
  color: #888;
  margin-top: 2px;
}

/* MAIN CONTENT */
.emt-main {
  padding: 28px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

/* GRID */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .emt-main { padding: 16px; }
  .page-header { padding: 16px; flex-direction: column; align-items: flex-start; gap: 12px; }
  #nav-links, .nav-spacer, .nav-user, #logout-btn { display: none !important; }
  .nav-hamburger { display: flex !important; }
}

/* MOBILE NAV HAMBURGER */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--emt-dark);
  border-radius: 2px;
  transition: all 0.2s;
}

/* MOBILE NAV OVERLAY */
#nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 500;
}
#nav-mobile-overlay.open { display: block; }

#nav-mobile-menu {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  overflow-y: auto;
  animation: slideInRight 0.22s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.nav-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--emt-border);
}
.nav-mobile-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #888;
  line-height: 1;
  padding: 4px;
}
.nav-mobile-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--emt-border);
  font-size: 14px;
  font-weight: 600;
}
.nav-mobile-user img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--emt-primary);
  object-fit: cover;
}
.nav-mobile-links { flex: 1; padding: 8px 0; }
.nav-mobile-link {
  display: block;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  color: #444;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.nav-mobile-link:hover { background: var(--emt-cream); color: var(--emt-dark); }
.nav-mobile-link.nav-active { color: var(--emt-primary); border-left-color: var(--emt-primary); background: #fff7f0; font-weight: 600; }
.nav-mobile-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--emt-border);
}

/* STATUS BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-new { background: #dbeafe; color: #1d4ed8; }
.badge-in-progress { background: #fef3c7; color: #b45309; }
.badge-confirmed { background: #dcfce7; color: #15803d; }
.badge-unconfirmed { background: #f3f4f6; color: #6b7280; }
.badge-rejected { background: #fee2e2; color: #dc2626; }
.badge-delivered { background: #dcfce7; color: #15803d; }

/* PRICING BOXES */
.price-box {
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.price-box-blue { background: #eff6ff; border: 2px solid #3b82f6; }
.price-box-orange { background: #fff7ed; border: 2px solid var(--emt-primary); }
.price-box-red { background: #fef2f2; border: 2px solid #ef4444; }

.price-box .price-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.price-box .price-value { font-size: 24px; font-weight: 800; }
.price-box .price-sub { font-size: 11px; color: #888; margin-top: 2px; }

/* INCLUSION CHECKS */
.inclusion-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
}
.inclusion-item input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--emt-primary);
  cursor: pointer;
}

/* DAY BUILDER */
.day-item {
  border: 1px solid var(--emt-border);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 12px;
  overflow: hidden;
}
.day-header {
  background: var(--emt-cream);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
}
.day-body { padding: 16px; }

/* ANIMATIONS */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in { animation: fadeIn 0.3s ease; }

/* FOLLOW-UP ALERT */
.followup-alert {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.followup-alert.overdue {
  background: #fef2f2;
  border-color: #fecaca;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: fadeInUp 0.25s ease;
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--emt-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #888;
  padding: 4px;
  line-height: 1;
}
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--emt-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* DIVIDER */
.divider {
  border: none;
  border-top: 1px solid var(--emt-border);
  margin: 20px 0;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #aaa;
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* TABS */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--emt-border);
  margin-bottom: 20px;
}
.tab {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  border-radius: 6px 6px 0 0;
}
.tab:hover { color: var(--emt-primary); }
.tab.active { color: var(--emt-primary); border-bottom-color: var(--emt-primary); font-weight: 600; }

/* LOGIN PAGE */
.login-page {
  min-height: 100vh;
  background: var(--emt-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* SIDEBAR FORM LAYOUT */
.form-sidebar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) {
  .form-sidebar { grid-template-columns: 1fr; }
}

/* PRINT / PDF PREVIEW */
@media print {
  .emt-nav, .page-header, .btn, .no-print { display: none !important; }
  .emt-main { padding: 0; max-width: 100%; }
}
