/* ================================================================== */
/*  Zmoremo Back Office — theme                                        */
/*  Palette mirrors the public lander (ZmoremoWeb):                    */
/*  fresh green + medium-dark blue "ink" on paper.                     */
/* ================================================================== */
:root {
  /* Brand green */
  --brand-50:  #eef9f4;
  --brand-100: #d3f1e2;
  --brand-200: #a9e3c7;
  --brand-300: #74d0a7;
  --brand-400: #40b788;
  --brand-500: #1fa97c; /* primary */
  --brand-600: #148a65;
  --brand-700: #126e53;
  --brand-800: #135844;
  --brand-900: #114838;

  /* Ink (medium dark blue) */
  --ink-50:  #eef3f9;
  --ink-100: #d6e2f0;
  --ink-200: #adc3dd;
  --ink-300: #7d9dc2;
  --ink-400: #4f74a0;
  --ink-500: #395c86;
  --ink-600: #2d4d72;
  --ink-700: #274b6d; /* primary dark blue */
  --ink-800: #203c56;
  --ink-900: #1a3045;

  --paper: #f7faf9;

  --sidebar-width: 260px;

  /* Re-theme Bootstrap's primary to brand green */
  --bs-primary: var(--brand-500);
  --bs-primary-rgb: 31, 169, 124;
  --bs-link-color: var(--brand-600);
  --bs-link-color-rgb: 20, 138, 101;
  --bs-link-hover-color: var(--brand-700);
  --bs-border-radius: 0.6rem;
  --bs-body-color: var(--ink-900);
  --bs-body-bg: var(--paper);
}

html { font-size: 14px; position: relative; min-height: 100%; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink-900);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
  font-family: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
}

/* ---- Icons -------------------------------------------------------- */
.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  vertical-align: -0.18em;
}

/* ---- Buttons / focus ---------------------------------------------- */
.btn-primary {
  --bs-btn-bg: var(--brand-500);
  --bs-btn-border-color: var(--brand-500);
  --bs-btn-hover-bg: var(--brand-600);
  --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-active-bg: var(--brand-700);
  --bs-btn-active-border-color: var(--brand-700);
  --bs-btn-disabled-bg: var(--brand-300);
  --bs-btn-disabled-border-color: var(--brand-300);
  color: #fff;
}
.btn-outline-primary {
  --bs-btn-color: var(--brand-600);
  --bs-btn-border-color: var(--brand-500);
  --bs-btn-hover-bg: var(--brand-500);
  --bs-btn-hover-border-color: var(--brand-500);
  --bs-btn-active-bg: var(--brand-600);
}
.btn:focus, .btn:active:focus, .form-control:focus,
.form-select:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(31, 169, 124, 0.25);
  border-color: var(--brand-400);
}
.text-primary { color: var(--brand-600) !important; }
.bg-primary { background-color: var(--brand-500) !important; }
a { color: var(--brand-600); }
a:hover { color: var(--brand-700); }

/* ================================================================== */
/*  App shell + sidebar                                                */
/* ================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  flex: none;
  background: var(--ink-800);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1045;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.25rem 1.25rem;
  color: #fff;
  text-decoration: none;
  font-family: "Space Grotesk", sans-serif;
}
.sidebar-brand:hover { color: #fff; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  width: 2.5rem;
  border-radius: 0.85rem;
  background: var(--brand-500);
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 8px 20px -8px rgba(31, 169, 124, 0.7);
}
.brand-word { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.05; }
.brand-word .dot { color: var(--brand-400); }
.brand-sub { font-size: 0.7rem; color: var(--ink-200); font-weight: 500; letter-spacing: 0.02em; }

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.sidebar-heading {
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--ink-300);
  padding: 1rem 0.75rem 0.35rem;
  font-weight: 600;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.6rem;
  color: var(--ink-100);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.94rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.sidebar-link .icon { width: 1.2rem; height: 1.2rem; color: var(--ink-300); transition: color 0.15s ease; }
.sidebar-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sidebar-link:hover .icon { color: var(--brand-300); }
.sidebar-link.active { background: var(--brand-500); color: #fff; }
.sidebar-link.active .icon { color: #fff; }

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.85rem 1rem;
}
.lang-switch { font-size: 0.8rem; color: var(--ink-300); }
.lang-opt { color: var(--ink-300); text-decoration: none; font-weight: 600; padding: 0 0.15rem; }
.lang-opt:hover { color: #fff; }
.lang-opt.active { color: var(--brand-300); }
.lang-sep { color: var(--ink-500); }

.sidebar-user { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.6rem; }
.user-avatar {
  height: 2.1rem; width: 2.1rem; border-radius: 50%;
  background: var(--ink-600); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex: none;
}
.user-name { font-size: 0.88rem; font-weight: 600; line-height: 1.1; }
.user-role { font-size: 0.72rem; color: var(--ink-200); }

/* Content area */
.app-content {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}
.topbar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--ink-800);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1030;
}
.topbar .brand-word { font-size: 1.05rem; }
.app-main { padding: 1.75rem clamp(1rem, 3vw, 2.25rem); flex: 1 1 auto; }

.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(26, 48, 69, 0.5);
  z-index: 1040; display: none;
}

/* Cards / tables polish */
.card { border: 1px solid var(--ink-100); border-radius: var(--bs-border-radius); }
.card.shadow-sm { box-shadow: 0 8px 24px -18px rgba(26, 48, 69, 0.55) !important; }

/* Icon button (menu toggle) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2.4rem; width: 2.4rem; border-radius: 0.6rem;
  background: transparent; color: #fff; border: none; font-size: 1.25rem;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); }

/* ---- Mobile ------------------------------------------------------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 60px rgba(0,0,0,0.3); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .app-content { margin-left: 0; }
  .topbar { display: flex; }
}

/* Full-width (no sidebar) pages such as the login screen */
.plain-main { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
