/* ============================================
   ParcelPro — Main CSS
   Design: Dark navy + orange accent
   ============================================ */

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

:root {
  --bg: #0f1117;
  --bg2: #181c27;
  --bg3: #1f2435;
  --sidebar-bg: #13161f;
  --card-bg: #1a1f2e;
  --border: #2a2f45;
  --accent: #f97316;
  --accent-hover: #ea6a0a;
  --accent-light: rgba(249,115,22,0.12);
  --green: #22c55e;
  --green-light: rgba(34,197,94,0.12);
  --red: #ef4444;
  --red-light: rgba(239,68,68,0.12);
  --blue: #3b82f6;
  --blue-light: rgba(59,130,246,0.12);
  --yellow: #eab308;
  --yellow-light: rgba(234,179,8,0.12);
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #64748b;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ---- Buttons ---- */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.55rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary.full { width: 100%; justify-content: center; }
.btn-primary.large { padding: 0.8rem 1.5rem; font-size: 1rem; }
.btn-primary.sm { padding: 0.38rem 0.85rem; font-size: 0.82rem; }

.btn-secondary {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-secondary:hover { background: var(--border); color: var(--text); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.55rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-outline:hover { background: var(--accent-light); }
.btn-outline.full { width: 100%; justify-content: center; }

.btn-danger {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 0.55rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-danger:hover { background: var(--red); color: #fff; }

/* ---- Form Elements ---- */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-size: 0.82rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.03em; }
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.6rem 0.85rem;
  font-size: 0.93rem;
  font-family: inherit;
  transition: border-color 0.18s;
  outline: none;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; }
.form-group select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 1rem; padding-right: 2rem; }

.readonly-field { opacity: 0.65; cursor: not-allowed; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }

.form-error { color: var(--red); font-size: 0.85rem; min-height: 1.2rem; margin-top: 0.3rem; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-box.wide { max-width: 680px; }
.modal-box.small { max-width: 400px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-header button { background: none; border: none; color: var(--text3); font-size: 1.2rem; cursor: pointer; line-height: 1; }
.modal-header button:hover { color: var(--text); }

.modal-body { padding: 1.4rem; }
.modal-body p { color: var(--text2); margin-bottom: 0.8rem; }

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--green);
  color: #fff;
  padding: 0.7rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 9999;
}
.toast.error { background: var(--red); }
.toast.show { opacity: 1; }

/* ---- Status badges ---- */
.badge {
  display: inline-block;
  padding: 0.22rem 0.65rem;
  border-radius: 50px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-pending { background: var(--yellow-light); color: var(--yellow); }
.badge-shipped { background: var(--blue-light); color: var(--blue); }
.badge-delivered { background: var(--green-light); color: var(--green); }
.badge-cancelled { background: var(--red-light); color: var(--red); }

/* ---- Action icon buttons ---- */
.action-btns { display: flex; gap: 0.4rem; }
.icon-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text2);
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.18s;
  text-decoration: none;
  display: inline-flex; align-items: center;
}
.icon-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.icon-btn.danger:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }

/* ---- Misc ---- */
.section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  margin: 1.5rem 0 0.8rem;
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
  .modal-footer { flex-direction: column; }
  .modal-footer button { width: 100%; }
}
