/* ============================================================
   GiftDost admin theme — restyles AdminLTE 3 to match the
   Talento Figma design (violet, floating white sidebar, soft
   lavender canvas, rounded cards, pill badges). Loaded AFTER
   adminlte.min.css so these rules win.
   ============================================================ */

:root {
  --gd-primary: #CC3366;        /* giftdost.com brand pink */
  --gd-primary-600: #A82A54;    /* deeper pink for gradients */
  --gd-primary-050: #FCEBF1;    /* light pink tint (active nav, row hover) */
  --gd-lavender: #F8BFD4;       /* light pink accent */
  --gd-ink: #1C1C28;
  --gd-muted: #7C7C7C;
  --gd-muted-2: #A0A0AB;
  --gd-line: #ECECF3;
  --gd-canvas: #FBF5F8;
  --gd-green: #16A249;
  --gd-green-bg: #E7F7EE;
  --gd-red: #FF5B5B;
  --gd-red-bg: #FDECEC;
  --gd-blue: #0DA2E7;
  --gd-blue-bg: #E6F6FD;
  --gd-cyan: #06B6D4;
  --gd-cyan-bg: #E4FAFD;
  --gd-amber: #F59E0B;
  --gd-amber-bg: #FEF4E6;
  --gd-radius: 16px;
  --gd-radius-sm: 10px;
  --gd-gradient: linear-gradient(120deg, var(--gd-primary-600), var(--gd-primary));
}

body,
.wrapper {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--gd-ink);
  background: var(--gd-canvas);
}

/* Soft decorative purple shape behind the top-left corner */
.wrapper::before {
  content: '';
  position: fixed;
  top: -120px;
  left: -120px;
  width: 320px;
  height: 320px;
  background: var(--gd-gradient);
  opacity: .18;
  border-radius: 0 0 60% 0;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Sidebar ---------- */
.main-sidebar {
  background: #ffffff !important;
  box-shadow: 0 10px 40px rgba(204, 51, 102, .07);
  border-right: 1px solid var(--gd-line);
}
.main-sidebar,
.main-sidebar .sidebar { overflow: visible; }

/* Brand / logo block */
.gd-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 20px 8px;
}
.gd-brand .gd-brand-logo {
  max-width: 180px;
  max-height: 46px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.gd-brand .gd-brand-dot {
  color: var(--gd-primary);
}

/* Row thumbnail in list tables (products), the way Shopify previews a product
   next to its name. Fixed box so a portrait and a landscape image line up. */
.gd-row-thumb {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 6px;
  object-fit: cover;
  background: #f4f5f7;
  border: 1px solid var(--gd-line, #ECECF3);
}
.gd-row-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b9bcc7;
  font-size: 14px;
}

/* Full-screen loading splash — the square brand mark, a little larger than
   AdminLTE's stock 60px. max-* rather than fixed width/height so the source
   image's own proportions are never stretched. */
.preloader .gd-preloader-logo {
  max-width: 84px;
  max-height: 84px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* User profile card at the top of the sidebar */
.main-sidebar .user-panel {
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  border-bottom: 1px solid var(--gd-line) !important;
  padding: 6px 20px 18px !important;
  margin: 0 0 10px !important;
}
.main-sidebar .user-panel .image {
  margin-bottom: 10px;
  position: relative;
}
.main-sidebar .user-panel .image img {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
}
.main-sidebar .user-panel .info { padding: 0; }
.main-sidebar .user-panel .info .gd-name {
  font-weight: 700;
  font-size: 18px;
  color: var(--gd-ink);
  line-height: 1.2;
}
.main-sidebar .user-panel .info .gd-role {
  font-size: 13px;
  color: var(--gd-muted);
}

/* Nav items */
.main-sidebar .nav-sidebar { padding: 0 12px; }
.main-sidebar .nav-sidebar .nav-item { margin-bottom: 2px; }
.main-sidebar .nav-sidebar > .nav-item > .nav-link {
  color: var(--gd-ink);
  border-radius: var(--gd-radius-sm);
  padding: 11px 14px;
  font-weight: 500;
  font-size: 15px;
  position: relative;
}
.main-sidebar .nav-sidebar .nav-link .nav-icon {
  color: var(--gd-muted-2);
  font-size: 17px;
  width: 22px;
}
.main-sidebar .nav-sidebar .nav-link p { margin-left: 4px; }

.main-sidebar .nav-sidebar > .nav-item > .nav-link:hover {
  background: #FafaFd;
  color: var(--gd-ink);
}
/* Active item — light purple pill + accent bar + purple text/icon */
.main-sidebar .nav-sidebar > .nav-item > .nav-link.active,
.main-sidebar .nav-sidebar .nav-treeview > .nav-item > .nav-link.active {
  background: var(--gd-primary-050) !important;
  color: var(--gd-primary) !important;
  box-shadow: none;
}
.main-sidebar .nav-sidebar > .nav-item > .nav-link.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--gd-primary);
}
.main-sidebar .nav-sidebar > .nav-item > .nav-link.active .nav-icon { color: var(--gd-primary); }

.main-sidebar .nav-treeview .nav-link {
  color: var(--gd-muted);
  border-radius: var(--gd-radius-sm);
  padding: 8px 14px;
  font-size: 14px;
}
.main-sidebar .nav-treeview .nav-link .nav-icon { font-size: 8px; }

/* ---------- Top navbar ---------- */
/* Navbar + page header form one continuous white block that stays stuck to the
   top while the page content scrolls beneath it. No border between them, so
   they read as one piece; the divider/shadow lives on .content-header's bottom. */
.main-header.navbar {
  background: #ffffff !important;
  border: 0 !important;
  box-shadow: none;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 1030;
}
.main-header .nav-link { color: var(--gd-muted) !important; }
.main-header .nav-link:hover { color: var(--gd-primary) !important; }
/* User chip — purple pill */
.main-header .user-menu > .nav-link {
  background: var(--gd-gradient);
  color: #fff !important;
  border-radius: 40px;
  padding: 6px 14px 6px 6px !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.main-header .user-menu > .nav-link .user-image {
  margin: 0;
  height: 30px;
  width: 30px;
}
.main-header .user-menu > .nav-link span { color: #fff !important; }

/* ---------- Content ---------- */
.content-wrapper { background: transparent !important; }
.content-header h1 {
  font-weight: 700;
  font-size: 26px;
  color: var(--gd-ink);
}
.content-header .breadcrumb {
  background: transparent;
  padding: 0;
  margin: 2px 0 0;
  font-size: 13px;
}
.content-header .breadcrumb-item.active { color: var(--gd-muted); }

/* Cards */
.card {
  border: 0;
  border-radius: var(--gd-radius);
  box-shadow: 0 6px 24px rgba(28, 28, 40, .05);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--gd-line);
  font-weight: 600;
}
.card-header .card-title { font-weight: 600; font-size: 18px; }

/* Buttons */
.btn-primary,
.btn-secondary.btn-block[type="submit"] {
  background: var(--gd-gradient);
  border: 0;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn { border-radius: 10px; font-weight: 500; }
.btn-xs { border-radius: 8px; }

/* Pill badges */
.badge {
  border-radius: 40px;
  padding: 5px 12px;
  font-weight: 600;
  font-size: 12px;
}
.badge-success { background: var(--gd-green-bg); color: var(--gd-green); }
.badge-danger  { background: var(--gd-red-bg);   color: var(--gd-red); }
.badge-warning { background: var(--gd-amber-bg); color: var(--gd-amber); }
.badge-info    { background: var(--gd-blue-bg);  color: var(--gd-blue); }
.badge-secondary { background: #F1F1F5; color: var(--gd-muted); }

/* Tables */
.table { color: var(--gd-ink); }
.table thead th {
  border: 0;
  border-bottom: 1px solid var(--gd-line);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--gd-muted-2);
  font-weight: 600;
}
.table td, .table th { border-top: 1px solid var(--gd-line); vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--gd-primary-050); }
/* Safety net: any table that still carries table-bordered / table-striped is
   normalized to the clean row-separator look above, so every table in the panel
   matches regardless of the classes a view happens to use. */
.table-bordered, .table-bordered td, .table-bordered th { border: 0; }
.table-bordered td, .table-bordered th { border-top: 1px solid var(--gd-line); }
.table-bordered thead th { border-top: 0; border-bottom: 1px solid var(--gd-line); }
.table-striped tbody tr:nth-of-type(odd) { background-color: transparent; }

/* AdminLTE gives .card-header a clearfix ::after (and ::before). Inside a flexbox
   those become phantom flex items, so `justify-content-between` splits space across
   three items and pushes the button to the MIDDLE instead of the right edge. Drop
   them for flex headers so title-left / button-right works everywhere. */
.card-header.d-flex::before, .card-header.d-flex::after { display: none !important; }

/* ---------- Dashboard-specific ---------- */
.gd-stat {
  background: #fff;
  border-radius: var(--gd-radius);
  box-shadow: 0 6px 24px rgba(28, 28, 40, .05);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.gd-stat.is-featured { border: 1.5px solid var(--gd-primary); }
.gd-stat .gd-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--gd-primary-050);
  color: var(--gd-primary);
}
.gd-stat .gd-stat-num { font-size: 30px; font-weight: 800; line-height: 1; color: var(--gd-ink); }
.gd-stat .gd-stat-label { color: var(--gd-muted); font-size: 15px; margin-top: 4px; }
.gd-stat.gd-stat-lg { justify-content: space-between; }
.gd-stat.gd-stat-lg .gd-stat-num { font-size: 34px; }

/* Pipeline chips */
.gd-chip {
  background: #fff;
  border-radius: var(--gd-radius-sm);
  box-shadow: 0 4px 18px rgba(28, 28, 40, .04);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.gd-chip .gd-chip-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; flex: 0 0 auto;
}
.gd-chip .gd-chip-label { color: var(--gd-muted); font-size: 14px; flex: 1; }
.gd-chip .gd-chip-count { font-weight: 800; font-size: 18px; }
.gd-c-purple { background: var(--gd-primary); }
.gd-c-blue   { background: var(--gd-blue); }
.gd-c-green  { background: var(--gd-green); }
.gd-c-amber  { background: var(--gd-amber); }
.gd-c-red    { background: var(--gd-red); }
.gd-c-cyan   { background: var(--gd-cyan); }
.gd-count-purple { color: var(--gd-primary); }
.gd-count-blue   { color: var(--gd-blue); }
.gd-count-green  { color: var(--gd-green); }
.gd-count-amber  { color: var(--gd-amber); }
.gd-count-red    { color: var(--gd-red); }
.gd-count-cyan   { color: var(--gd-cyan); }

.gd-section-title { font-weight: 700; font-size: 18px; color: var(--gd-ink); margin: 4px 0 12px; }

/* Pagination */
.pagination .page-link { border: 0; color: var(--gd-muted); border-radius: 8px; margin: 0 2px; }
.pagination .page-item.active .page-link { background: var(--gd-gradient); color: #fff; }

/* Footer */
.main-footer { background: transparent; border-top: 1px solid var(--gd-line); color: var(--gd-muted); }

/* ============================================================
   Phase 2 — forms, buttons, filters, headers across all pages
   ============================================================ */

/* Page header (content-header used on every list/detail page) — its own white
   band, separated from the navbar above and the content below by a gap. */
.content-header {
  background: #ffffff;
  padding: 20px 8px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--gd-line);
  box-shadow: 0 4px 8px rgba(28, 28, 40, .04);
  /* Sticks directly under the navbar (offset = navbar height, set by JS in the
     layout as --gd-navbar-h) so the whole header block stays fixed on scroll. */
  position: sticky;
  top: var(--gd-navbar-h, 60px);
  z-index: 1020;
}
.content-header h1 { font-size: 24px; }

/* Form controls */
.form-control,
.custom-select,
select.form-control,
textarea.form-control {
  border: 1px solid var(--gd-line);
  border-radius: 10px;
  color: var(--gd-ink);
  font-size: 14px;
  min-height: 42px;
  box-shadow: none;
}
textarea.form-control { min-height: 90px; }
.form-control::placeholder { color: var(--gd-muted-2); }
.form-control:focus,
.custom-select:focus {
  border-color: var(--gd-primary);
  box-shadow: 0 0 0 3px rgba(204, 51, 102, .15);
}
label { font-weight: 500; color: var(--gd-ink); font-size: 14px; margin-bottom: 4px; }
.input-group-text {
  border: 1px solid var(--gd-line);
  background: #F7F7FB;
  color: var(--gd-muted);
  border-radius: 10px;
}
.input-group > .input-group-prepend > .input-group-text { border-right: 0; border-radius: 10px 0 0 10px; }
.input-group > .form-control:not(:first-child) { border-radius: 0 10px 10px 0; }

/* Custom checkbox/switch accent */
.custom-control-input:checked ~ .custom-control-label::before {
  background: var(--gd-primary);
  border-color: var(--gd-primary);
}

/* Buttons — semantic variants, all pill-rounded */
.btn { border-radius: 10px; font-weight: 500; }
.btn-info    { background: var(--gd-blue);  border: 0; color: #fff; }
.btn-success { background: var(--gd-green); border: 0; color: #fff; }
.btn-danger  { background: var(--gd-red);   border: 0; color: #fff; }
.btn-warning { background: var(--gd-amber); border: 0; color: #fff; }
.btn-info:hover, .btn-success:hover, .btn-danger:hover, .btn-warning:hover { filter: brightness(1.05); color: #fff; }
.btn-default,
.btn-secondary {
  background: #fff;
  border: 1px solid var(--gd-line);
  color: var(--gd-ink);
}
.btn-default:hover, .btn-secondary:hover { background: #F7F7FB; color: var(--gd-ink); }
.btn-link { color: var(--gd-primary); }
.btn-outline-primary { color: var(--gd-primary); border-color: var(--gd-primary); }
.btn-outline-primary:hover { background: var(--gd-primary); }
/* Table action buttons sit closer together */
.table .btn-xs { padding: 3px 10px; margin: 1px; }

/* Filter card (the grey filter bar on list pages) */
.card-body.border-bottom { border-bottom: 1px solid var(--gd-line) !important; }

/* Pagination active already themed; make the wrapper breathe */
.pagination { margin-top: 6px; }

/* AdminLTE small-box (in case any page still uses it) */
.small-box { border-radius: var(--gd-radius); box-shadow: 0 6px 24px rgba(28,28,40,.05); }

/* Sensible spacing for section content */
.content > .container-fluid { padding-top: 6px; }

/* Modals (vendor add/edit, etc.) */
.modal-content { border: 0; border-radius: var(--gd-radius); }
.modal-header { border-bottom: 1px solid var(--gd-line); }
.modal-footer { border-top: 1px solid var(--gd-line); }

/* Toastr rounded to match */
.toast { border-radius: 12px !important; }

/* ============================================================
   Mobile / responsive
   ============================================================ */
html, body { max-width: 100%; }

@media (max-width: 991.98px) {
  /* Never let the page itself scroll sideways — wide content scrolls inside
     its own card instead (see below). */
  body { overflow-x: hidden; }

  /* Wide tables scroll horizontally within their card, keeping the page width
     pinned to the viewport. */
  .content-wrapper .card-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Card headers with an action button (e.g. "View all orders") wrap instead
     of overflowing. */
  .card-header.d-flex { flex-wrap: wrap; gap: 8px; }

  /* The decorative corner is distracting on small screens. */
  .wrapper::before { display: none; }

  /* Tighter page padding on phones. */
  .content > .container-fluid,
  .content-header .container-fluid { padding-left: 12px; padding-right: 12px; }

  .content-header h1 { font-size: 21px; }
  .gd-stat .gd-stat-num { font-size: 26px; }
}

@media (max-width: 575.98px) {
  /* Stat cards and filter fields go full width and stack cleanly. */
  .gd-stat { padding: 18px; }
  .form-row > [class*="col-"] { margin-bottom: 8px; }
}
