/* ============================================================
   Tom&Portal — Global Styles
   Tailwind + DaisyUI (thème tomandco) complète les utilitaires.
   Ce fichier gère uniquement ce qui n'est pas couvert par Tailwind/DaisyUI.
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
  --green:   #1F6B4A;
  --green-2: #2E8B63;
  --orange:  #F25C3A;
  --ink:     #17211c;
  --muted:   rgba(23,33,28,.65);
  --card:    rgba(255,255,255,.88);
  --border:  rgba(23,33,28,.10);
  --shadow:  0 20px 60px rgba(0,0,0,.08);
  --radius:  18px;
}

/* ── Reset minimal ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Body & Background ────────────────────────────────────── */
body {
  margin: 0;
  color: var(--ink);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 50% -120px, rgba(46,139,99,.20), rgba(46,139,99,0)),
    radial-gradient(900px 500px at 15% 30%,     rgba(242,92,58,.10), rgba(242,92,58,0)),
    linear-gradient(180deg, #F2F7F3, #ECF4EE);
  background-attachment: fixed;
}

a { color: inherit; }

/* ── Topbar (sticky, glassmorphism) ──────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.accent-line {
  height: 5px;
  background: linear-gradient(90deg, var(--orange), rgba(242,92,58,.35), transparent);
}

/* ── Brand (logo + texte) ────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 220px;
}
.brand-logo   { height: 30px; width: auto; display: block; }
.brand-title  { font-weight: 900; letter-spacing: .2px; line-height: 1.1; }
.brand-subtitle { font-size: 12px; color: rgba(23,33,28,.60); }

/* ── Navigation ──────────────────────────────────────────── */
.navlinks {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.navlink {
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: rgba(23,33,28,.85);
  transition: background .15s, border-color .15s;
}
.navlink:hover         { background: rgba(31,107,74,.08); border-color: rgba(31,107,74,.14); }
.navlink-logout:hover  { background: rgba(242,92,58,.10); border-color: rgba(242,92,58,.18); }

/* ── Cards & Panels ──────────────────────────────────────── */
.card, .panel, .manual-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 22px; }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5 { margin: 0 0 10px; }
.text-muted { color: var(--muted); }

/* ── Buttons (classes legacy + DaisyUI override) ─────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  transition: filter .15s, background .15s;
}
.btn-primary {
  background: linear-gradient(180deg, var(--green-2), var(--green));
  color: #fff;
  box-shadow: 0 8px 20px rgba(31,107,74,.22);
}
.btn-primary:hover { filter: brightness(1.04); }

.btn-outline-secondary {
  background: rgba(255,255,255,.65);
  border-color: var(--border);
  color: var(--ink);
}
.btn-outline-secondary:hover {
  background: rgba(31,107,74,.06);
  border-color: rgba(31,107,74,.15);
}
.btn-orange {
  background: linear-gradient(180deg, #ff6a4b, var(--orange));
  color: #fff;
  box-shadow: 0 8px 20px rgba(242,92,58,.20);
}
.btn-orange:hover { filter: brightness(1.04); }
.btn-dark {
  background: var(--ink);
  color: #fff;
}

/* ── Forms ────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.80);
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(31,107,74,.35);
  box-shadow: 0 0 0 4px rgba(31,107,74,.10);
}
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

/* ── Tables ──────────────────────────────────────────────── */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th {
  text-align: left;
  font-size: 12px;
  letter-spacing: .2px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(242,92,58,.08);
  color: rgba(23,33,28,.75);
  position: sticky;
  top: 0;
  z-index: 2;
}
td { padding: 10px 12px; border-bottom: 1px solid rgba(23,33,28,.05); }
tr:hover td { background: rgba(31,107,74,.03); }

.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }

/* ── Tabs (vanilla JS) ───────────────────────────────────── */
.tabbar { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  font-weight: 700;
  font-size: 14px;
  color: rgba(23,33,28,.50);
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  transition: background .15s, color .15s;
}
.tab.active {
  background: rgba(31,107,74,.08);
  color: var(--green);
  border-color: rgba(31,107,74,.15);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert-success { background: rgba(31,107,74,.10); color: var(--green); border-color: rgba(31,107,74,.18); }
.alert-danger  { background: rgba(242,92,58,.10);  color: #c0392b; border-color: rgba(242,92,58,.18); }
.alert-warning { background: rgba(245,158,11,.10); color: #92400e; border-color: rgba(245,158,11,.18); }

/* ── Layout helpers ──────────────────────────────────────── */
.center-screen {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 18px;
}
.login-card { width: min(520px, 100%); }

/* ── Table compact controls ──────────────────────────────── */
.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.mini-select {
  height: 36px; padding: 5px 10px;
  border-radius: 10px; border: 1px solid rgba(0,0,0,.12);
  background: #fff; min-width: 120px;
}
.mini-btn {
  height: 36px; padding: 0 12px;
  border-radius: 10px; border: 1px solid rgba(0,0,0,.12);
  background: #fff; cursor: pointer; font-weight: 600;
}
.mini-btn:disabled, .mini-select:disabled { opacity: .5; cursor: not-allowed; }

/* ── Column width hints ──────────────────────────────────── */
.col-warn   { min-width: 130px; }
.col-warnby { min-width: 200px; }
.col-contact{ min-width: 160px; }
.col-warnat { min-width: 170px; }

/* ── Orders tables ───────────────────────────────────────── */
.order-items table,
table.order-items  { min-width: 980px; }

table input[type="number"],
table input[type="text"],
table select { width: 100%; min-width: 110px; padding: 8px 10px; border-radius: 10px; }
table input[type="number"] { min-width: 80px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar-inner { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
  .brand        { min-width: 0; }
  .navlinks     { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .navlinks::-webkit-scrollbar       { height: 4px; }
  .navlinks::-webkit-scrollbar-thumb { background: rgba(23,33,28,.18); border-radius: 999px; }
  .navlink      { white-space: nowrap; flex: 0 0 auto; }

  .card         { padding: 16px; }
  h1            { font-size: 22px; }
  h2            { font-size: 18px; }
  th            { font-size: 11px; padding: 8px 10px; }
  td            { padding: 9px 10px; }
  table         { min-width: 780px; }
  .inline-form  { flex-wrap: wrap; }
  .mini-select, .mini-btn { width: 100%; max-width: 100%; }
}
