/*
 * FILE: /assets/css/mbt-theme.css
 * PURPOSE: Shared theme styles for all MBT internal portal pages (TMS/WMS).
 *          Matches the brand colors and feel of index.html public website.
 *
 * USAGE: Link this in every portal page:
 *   <link rel="stylesheet" href="/assets/css/mbt-theme.css">
 *
 * FONTS LOADED HERE: Playfair Display + DM Sans (from Google Fonts CDN)
 * NOTE: Per project rules, fonts use CDN. Bootstrap uses local /assets/ files.
 */

/* ── ROOT VARIABLES ────────────────────────────────────────────────────────── */
:root {
  /* Brand palette — matches index.html exactly */
  --teal:        #1a8a72;
  --teal-dark:   #0f5e4e;
  --teal-light:  #25b898;
  --gold:        #e8a020;
  --gold-light:  #f5c04a;
  --cream:       #faf8f3;
  --dark:        #12201c;
  --mid:         #2d4a40;
  --text:        #1e3028;
  --muted:       #6a8a7a;
  --white:       #ffffff;

  /* UI utility colors */
  --danger:      #dc3545;
  --success:     #198754;
  --warning:     #ffc107;
  --info:        #0dcaf0;
  --border:      #e0e8e4;
  --bg-light:    #f4f7f5;
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:   0 6px 24px rgba(0,0,0,0.10);
  --shadow-lg:   0 16px 48px rgba(0,0,0,0.13);
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   18px;
}

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

html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }

/* ── TYPOGRAPHY ────────────────────────────────────────────────────────────── */
.font-display { font-family: 'Playfair Display', serif; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  color: var(--dark);
  line-height: 1.2;
}

/* ── SIDEBAR ───────────────────────────────────────────────────────────────── */
/* Section: Sidebar */
.mbt-sidebar {
  width: 250px;
  min-height: 100vh;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  transition: width 0.3s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,0.2);
}

.mbt-sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.mbt-sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--teal-light), var(--teal-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.mbt-sidebar-brand .brand-name {
  color: var(--white);
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  line-height: 1.2;
}

.mbt-sidebar-brand .brand-sub {
  color: var(--gold-light);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Sidebar Nav Items */
.mbt-nav { list-style: none; padding: 12px 0; flex: 1; }

.mbt-nav-section {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  padding: 14px 22px 6px;
  font-weight: 600;
}

.mbt-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  color: rgba(255,255,255,0.65);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: all 0.2s;
  position: relative;
}

.mbt-nav li a i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  transition: color 0.2s;
}

.mbt-nav li a:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
  padding-left: 26px;
}

.mbt-nav li a:hover i,
.mbt-nav li a.active i { color: var(--teal-light); }

.mbt-nav li a.active {
  background: rgba(37,184,152,0.15);
  color: var(--white);
  border-left: 3px solid var(--teal-light);
}
/* End: Sidebar */

/* ── TOPBAR ────────────────────────────────────────────────────────────────── */
/* Section: Topbar */
.mbt-topbar {
  height: 60px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: 250px;
  right: 0;
  z-index: 900;
  box-shadow: var(--shadow-sm);
}

.mbt-topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  font-family: 'Playfair Display', serif;
}

.mbt-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mbt-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--teal-light), var(--teal-dark));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.mbt-user-info {
  text-align: right;
  line-height: 1.2;
}

.mbt-user-info .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
}

.mbt-user-info .role {
  font-size: 11px;
  color: var(--muted);
}
/* End: Topbar */

/* ── MAIN CONTENT AREA ─────────────────────────────────────────────────────── */
/* Section: Main Wrapper */
.mbt-main {
  margin-left: 250px;
  margin-top: 60px;
  padding: 28px 28px;
  min-height: calc(100vh - 60px);
  background: var(--bg-light);
}
/* End: Main Wrapper */

/* ── CARDS ─────────────────────────────────────────────────────────────────── */
/* Section: Cards */
.mbt-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s;
}

.mbt-card:hover { box-shadow: var(--shadow-md); }

.mbt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.mbt-card-header h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mbt-card-header h5 i { color: var(--teal); }

/* Stat Cards */
.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card:hover::after { transform: scaleX(1); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.teal  { background: rgba(26,138,114,0.12); color: var(--teal); }
.stat-icon.gold  { background: rgba(232,160,32,0.12); color: var(--gold); }
.stat-icon.red   { background: rgba(220,53,69,0.10);  color: var(--danger); }
.stat-icon.blue  { background: rgba(13,202,240,0.10); color: #0dcaf0; }

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--dark);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.3px;
}
/* End: Cards */

/* ── BUTTONS ────────────────────────────────────────────────────────────────── */
/* Section: Buttons */
.btn-mbt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-mbt:focus { outline: none; box-shadow: 0 0 0 3px rgba(26,138,114,0.2); }
.btn-mbt:active { transform: scale(0.97); }
.btn-mbt:disabled,
.btn-mbt[disabled] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

.btn-mbt-primary {
  background: var(--teal);
  color: white;
  box-shadow: 0 4px 14px rgba(26,138,114,0.3);
}
.btn-mbt-primary:hover { background: var(--teal-dark); transform: translateY(-1px); }

.btn-mbt-gold {
  background: var(--gold);
  color: var(--dark);
  box-shadow: 0 4px 14px rgba(232,160,32,0.3);
}
.btn-mbt-gold:hover { background: var(--gold-light); transform: translateY(-1px); }

.btn-mbt-outline {
  background: transparent;
  color: var(--teal);
  border-color: var(--teal);
}
.btn-mbt-outline:hover { background: var(--teal); color: white; }

.btn-mbt-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 4px 14px rgba(220,53,69,0.25);
}
.btn-mbt-danger:hover { background: #b02a37; transform: translateY(-1px); }

.btn-mbt-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 5px;
}
/* End: Buttons */

/* ── TABLES ─────────────────────────────────────────────────────────────────── */
/* Section: Tables */
.mbt-table-wrap {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.mbt-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 2px solid var(--border);
  background: var(--white);
  flex-wrap: wrap;
  gap: 12px;
}

.mbt-table-header h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mbt-table-header h5 i { color: var(--teal); }

.mbt-table-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mbt-table-search input {
  padding: 8px 14px 8px 34px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%236a8a7a' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.415l-3.868-3.833zm-5.242 1.656a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E") no-repeat 10px center;
  transition: border-color 0.2s;
  width: 220px;
}

.mbt-table-search input:focus {
  outline: none;
  border-color: var(--teal);
  background-color: var(--white);
}

/* The actual table */
.mbt-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

.mbt-table thead th {
  background: var(--bg-light);
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.mbt-table thead th:hover { color: var(--teal); }
.mbt-table thead th.sort-asc::after  { content: ' ▲'; color: var(--teal); font-size: 9px; }
.mbt-table thead th.sort-desc::after { content: ' ▼'; color: var(--teal); font-size: 9px; }

.mbt-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.mbt-table tbody tr:last-child { border-bottom: none; }
.mbt-table tbody tr:hover { background: #f0faf6; }

.mbt-table tbody td {
  padding: 13px 16px;
  color: var(--text);
  vertical-align: middle;
}

/* Status badges */
.badge-active {
  background: rgba(25,135,84,0.12);
  color: var(--success);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge-inactive {
  background: rgba(220,53,69,0.10);
  color: var(--danger);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}

.badge-pending {
  background: rgba(255,193,7,0.15);
  color: #997000;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}

/* Pagination */
.mbt-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--white);
  flex-wrap: wrap;
  gap: 10px;
}

.mbt-pagination .page-info { font-size: 12px; color: var(--muted); }

.mbt-pagination .page-btns { display: flex; gap: 6px; }

.mbt-pagination .page-btns button {
  width: 32px; height: 32px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}

.mbt-pagination .page-btns button:hover,
.mbt-pagination .page-btns button.active {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
/* End: Tables */

/* ── FORM CONTROLS ──────────────────────────────────────────────────────────── */
/* Section: Forms */
.mbt-form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  display: block;
}

.mbt-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.mbt-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26,138,114,0.12);
}

.mbt-input::placeholder { color: var(--muted); opacity: 0.7; }

.mbt-input.is-error { border-color: var(--danger); }
.mbt-input.is-error:focus { box-shadow: 0 0 0 3px rgba(220,53,69,0.12); }

.mbt-error-text {
  font-size: 11.5px;
  color: var(--danger);
  margin-top: 4px;
}

.mbt-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
}

.mbt-select:focus { outline: none; border-color: var(--teal); }
/* End: Forms */

/* ── ALERTS ──────────────────────────────────────────────────────────────────── */
/* Section: Alerts */
.mbt-alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.mbt-alert-success { background: rgba(25,135,84,0.10); color: #145929; border-left: 4px solid var(--success); }
.mbt-alert-danger  { background: rgba(220,53,69,0.09);  color: #8b1c24; border-left: 4px solid var(--danger); }
.mbt-alert-warning { background: rgba(255,193,7,0.12);  color: #6b5000; border-left: 4px solid var(--warning); }
/* End: Alerts */

/* ── BREADCRUMB ──────────────────────────────────────────────────────────────── */
.mbt-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}

.mbt-breadcrumb a { color: var(--teal); }
.mbt-breadcrumb i { font-size: 9px; }

/* ── PAGE TITLE ──────────────────────────────────────────────────────────────── */
.mbt-page-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--dark);
  margin-bottom: 6px;
}

.mbt-page-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────────── */
/* Section: Responsive */
@media (max-width: 992px) {
  .mbt-sidebar { width: 70px; }
  .mbt-sidebar .brand-name,
  .mbt-sidebar .brand-sub,
  .mbt-nav li a span,
  .mbt-nav-section { display: none; }
  .mbt-nav li a { justify-content: center; padding: 14px; }
  .mbt-main { margin-left: 70px; }
  .mbt-topbar { left: 70px; }
}

@media (max-width: 768px) {
  .mbt-sidebar { display: none; }
  .mbt-main { margin-left: 0; padding: 16px; }
  .mbt-topbar { left: 0; padding: 0 16px; }
  .stat-value { font-size: 22px; }
  .mbt-table-search input { width: 150px; }
}
/* End: Responsive */
