@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* --------------------------------------------------------------------------------------
--------------------------------- Core style -------------------------------------------
-------------------------------------------------------------------------------------- */
:root {
  --nav-bg: #0A162A;
  --nav-fg: #ffffff;
  --top-bg: #f2f2f2;
  --top-fg: #3a3a3a;
  --content-bg: #ffffff;
  --content-fg: #000000;
  --app-bg: #7c7c7c;
  --header-height: 48px;
  --nav-collapsed-width: 60px;
  --subnav-expanded-width: 220px;
  --subnav-collapsed-width: 0px;
  --nav-gradient: linear-gradient(80deg, #0A162A 0%, #102238 70%, #14525c 100%);
  --nav-gradient-size: calc(var(--nav-collapsed-width) + var(--subnav-expanded-width));
}

body {
  min-height: 100vh;
  background: var(--app-bg);
  color: var(--content-fg);
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Banner */
.banner {
  padding: 12px 16px;
  margin: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  transition: all 150ms ease;
}

.banner.hidden {
  opacity: 0;
  max-height: 0;
  margin: 0 20px;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.banner-text {
  flex: 1;
  line-height: 1.3;
}

.banner-close {
  margin-left: auto;
  border: none;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 120ms ease;
}

.banner-close:hover {
  opacity: 1;
}

.banner-success {
  background: #e9f7ef;
  border-color: #c3e7d2;
  color: #1b5e20;
}

.banner-error {
  background: #fdecea;
  border-color: #f5c6c0;
  color: #b71c1c;
}

.banner-warning {
  background: #fff7e6;
  border-color: #ffe1a8;
  color: #a66300;
}

.banner-info {
  background: #e8f2ff;
  border-color: #c8dcff;
  color: #0b4f8a;
}

/* Toast alerts */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, 92vw);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  background: #ffffff;
  color: #1f2937;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: auto;
}

.toast-container .toast {
  display: flex !important;
}

.toast--show {
  opacity: 1;
  transform: translateY(0);
}

.toast--hide {
  opacity: 0;
  transform: translateY(6px);
}

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex: 0 0 28px;
}

.toast-message {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
}

.toast-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 2px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 120ms ease;
}

.toast-close:hover {
  opacity: 1;
}

.toast--success {
  background: #e9f7ef;
  border-color: #c3e7d2;
  color: #1b5e20;
}

.toast--success .toast-icon {
  background: #1b5e20;
}

.toast--info {
  background: #e8f2ff;
  border-color: #c8dcff;
  color: #0b4f8a;
}

.toast--info .toast-icon {
  background: #0b4f8a;
}

.toast--warning {
  background: #fff7e6;
  border-color: #ffe1a8;
  color: #a66300;
}

.toast--warning .toast-icon {
  background: #a66300;
}

.toast--error {
  background: #fdecea;
  border-color: #f5c6c0;
  color: #b71c1c;
}

.toast--error .toast-icon {
  background: #b71c1c;
}

@media (max-width: 900px) {
  .toast-container {
    top: calc(var(--header-height) + 12px);
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 150ms ease;
  z-index: 1200;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-container {
  background: var(--content-bg);
  color: var(--content-fg);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
  width: min(520px, 90vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(0) scale(1);
  transition: transform 150ms ease;
  overflow: hidden;
}

.modal-overlay.hidden .modal-container {
  transform: translateY(8px) scale(0.98);
}

.modal-header,
.modal-footer {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header {
  background: var(--nav-gradient);
  color: var(--nav-fg);
  justify-content: space-between;
  border-bottom: none;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: inherit;
}

.modal-body {
  padding: 16px;
  overflow: auto;
}

.modal-footer {
  border-top: none;
  justify-content: flex-end;
  gap: 8px;
}

.modal-close-btn {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  border-radius: 6px;
  transition: background 120ms ease, opacity 120ms ease;
}

.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  opacity: 0.9;
}

body.modal-open {
  overflow: hidden;
}

/* --------------------------------------------------------------------------------------
-------------------------------- Buttons ------------------------------------------------
-------------------------------------------------------------------------------------- */
.modal-action {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.modal-action:active {
  transform: translateY(1px);
}

.modal-action--secondary {
  background: #e5e7eb;
  color: #1f2933;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.modal-action--primary {
  background: #14525c;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(20, 82, 92, 0.25);
}

/* Standard Servira button */
.btn-servira_v2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #14525c 0%, #1c6a77 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(20, 82, 92, 0.22);
  transition: filter 120ms ease, opacity 120ms ease;
}

.btn-servira_v2__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 16px;
  line-height: 1;
}

.btn-servira_v2:hover {
  filter: brightness(1.05);
}

.btn-servira_v2:active {
  filter: brightness(0.98);
}

.btn-servira_v2:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.btn-servira_v2--sm {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 8px;
  gap: 8px;
}

.btn-servira_v2--danger {
  background: linear-gradient(135deg, #8f1b1b 0%, #b91c1c 100%);
  box-shadow: 0 10px 25px rgba(185, 28, 28, 0.2);
}

.btn-servira_v2,
a.btn-servira_v2,
a.btn-servira_v2:link,
a.btn-servira_v2:visited,
a.btn-servira_v2:hover,
a.btn-servira_v2:focus {
  text-decoration: none;
}

/* --------------------------------------------------------------------------------------
-------------------------------- Status pills ------------------------------------------------
-------------------------------------------------------------------------------------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.1;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7280;
}

.status-pill--active {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  color: #064e3b;
  border: 1px solid #0ea271;
}

.status-pill--active::before {
  background: #047857;
}

.status-pill--inactive {
  background: linear-gradient(90deg, #d1d5db 0%, #e5e7eb 100%);
  color: #374151;
  border: 1px solid #c3c7cf;
}

.status-pill--inactive::before {
  background: #6b7280;
}

.status-pill--archived {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
  color: #78350f;
  border: 1px solid #d97706;
}

.status-pill--archived::before {
  background: #b45309;
}

.status-pill--info {
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  color: #1e3a8a;
  border: 1px solid #2563eb;
}

.status-pill--info::before {
  background: #1d4ed8;
}

.status-pill--deleted {
  background: linear-gradient(90deg, #f87171 0%, #fca5a5 100%);
  color: #7f1d1d;
  border: 1px solid #ef4444;
}

.status-pill--deleted::before {
  background: #b91c1c;
}

/* --------------------------------------------------------------------------------------
-------------------------------- Content ------------------------------------------------ 
-------------------------------------------------------------------------------------- */

.content-page {
  padding: 12px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.content-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #667085;
  padding-left: 10px;
}

.page-title {
  margin: 2px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  padding-left: 10px;
}

.header-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #1f2937;
  font-size: 0.95rem;
  font-weight: 600;
}

.meta-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.12);
}

@media (max-width: 900px) {
  .content-page__header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* --------------------------------------------------------------------------------------
-------------------------------- Top search ---------------------------------------------
-------------------------------------------------------------------------------------- */

.top_panel .top-left {
  gap: 10px;
  flex-wrap: wrap;
}

.top_panel .top-left .top-search-block {
  display: inline-flex;
  align-items: center;
  background: #f9fafb;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  padding-right: 1px;
}

.top_panel .top-left .top-search-icon {
  width: 30px;
  height: 30px;
  padding: 5px;
  color: #6b7280;
}

.top_panel .top-left .top-search-input {
  border: none;
  background: transparent;
  border-left: 1px solid #d0d0d0;
  border-radius: 0 10px 10px 0;
  padding: 6px 8px;
  min-width: 260px;
  height: auto;
}

.top_panel .top-left .top-search-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(28, 106, 119, 0.15);
  border-color: #1c6a77;
}

/* --------------------------------------------------------------------------------------
-------------------------------- Tables ------------------------------------------------
-------------------------------------------------------------------------------------- */

.table_card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.servira_table_v2 {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
  min-width: 640px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.servira_table_v2 th,
.servira_table_v2 td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #edf1f5;
  vertical-align: middle;
  color: #0f172a;
  width: auto;
}

.servira_table_v2 th:first-child,
.servira_table_v2 td:first-child {
  width: 1%;
  white-space: nowrap;
}

.servira_table_v2 thead th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 700;
  color: #1f2937;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid #e5e7eb;
}

.servira_table_v2 tbody tr:hover {
  background: rgba(28, 106, 119, 0.16);
}

.servira_table_v2 tbody tr:nth-child(even):hover {
  background: rgba(28, 106, 119, 0.2);
}

.servira_table_v2 tbody tr:nth-child(even) {
  background: #f8fafc;
}

.servira_table_v2 .text-ellipsis {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.servira_table_v2 th:last-child,
.servira_table_v2 td:last-child {
  white-space: nowrap;
  text-align: right;
}

.servira_table_v2 .action-buttons {
  display: inline-flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  white-space: nowrap;
  justify-content: flex-end;
  margin-left: auto;
}

.servira_table_v2 .empty-row td {
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
}

@media (max-width: 900px) {
  .servira_table_v2 {
    min-width: 0;
  }

  .servira_table_v2 thead {
    display: none;
  }

  .servira_table_v2 tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    margin-bottom: 10px;
  }

  .servira_table_v2 tbody tr:hover {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  }

  .servira_table_v2 td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border: none;
    padding: 6px 4px;
    gap: 8px;
    font-weight: 600;
  }

  .servira_table_v2 td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #6b7280;
    min-width: 120px;
    text-align: left;
  }

  .servira_table_v2 .text-ellipsis {
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* --------------------------------------------------------------------------------------
-------------------------------- users_v2.html -------------------------------------------
-------------------------------------------------------------------------------------- */

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 16px;
  margin-top: 12px;
}

.user-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: #0f172a;
  position: relative;
}

.label-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.user-form-grid input,
.user-form-grid select {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #f9fafb;
  color: #111827;
}

.user-form-grid input:focus,
.user-form-grid select:focus {
  outline: 2px solid #1c6a77;
  border-color: #1c6a77;
  background: #ffffff;
}

.password-input {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input input {
  width: 100%;
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1c6a77;
  cursor: pointer;
  border-radius: 6px;
}

.password-toggle:focus-visible {
  outline: 2px solid #1c6a77;
  outline-offset: 2px;
}

.password-toggle svg {
  width: 22px;
  height: 22px;
}

.password-toggle .icon-eye {
  display: none;
}

/* --------------------------------------------------------------------------------------
-------------------------------- Login -------------------------------------------------
-------------------------------------------------------------------------------------- */

body.login-v2-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 15%, #243a5f 0%, #142338 42%, #0a162a 100%);
  color: #0f172a;
}

.login-v2-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  box-sizing: border-box;
}

.login-v2-card {
  width: min(420px, 100%);
  background: transparent;
  border-radius: 20px;
  border: none;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.login-v2-header {
  padding: 20px 24px;
  background: linear-gradient(120deg, #0a162a 0%, #102238 55%, #14525c 100%);
  text-align: center;
  border-radius: 20px 20px 0 0;
}

.login-v2-header-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.login-v2-logo {
  width: 46px;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.login-v2-title {
  margin: 0;
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.login-v2-body {
  padding: 28px 28px 32px;
  background: #ffffff;
  border-radius: 0 0 20px 20px;
}

.login-v2-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-v2-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.login-v2-label {
  font-weight: 600;
  color: #1f2937;
  font-size: 0.95rem;
}

.login-v2-input {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  background: #f8fafc;
  color: #0f172a;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.login-v2-input:focus {
  outline: 2px solid #1c6a77;
  border-color: #1c6a77;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(28, 106, 119, 0.18);
}

.login-v2-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.login-v2-button {
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  min-width: 160px;
  height: 46px;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.3px;
  color: #ffffff;
  background: linear-gradient(120deg, #0a162a 0%, #1c6a77 100%);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.18);
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.login-v2-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.22);
}

.login-v2-button:active {
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.16);
}

.login-v2-form .errorlist {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 600;
}

.login-v2-form .errorlist.nonfield {
  margin-bottom: 4px;
  background: #fdecea;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #f5c6c0;
}

@media (max-width: 480px) {
  .login-v2-wrapper {
    padding: 24px 16px;
  }

  .login-v2-header {
    padding: 16px 18px;
  }

  .login-v2-title {
    font-size: 1.25rem;
  }

  .login-v2-logo {
    width: 40px;
  }

  .login-v2-body {
    padding: 20px 18px 24px;
  }

  .login-v2-input {
    font-size: 0.95rem;
    padding: 11px 12px;
  }

  .login-v2-button {
    width: 100%;
    height: 44px;
  }
}

.password-toggle .icon-eye-closed {
  display: block;
}

.password-toggle.is-visible .icon-eye {
  display: block;
}

.password-toggle.is-visible .icon-eye-closed {
  display: none;
}

.user-form-error {
  margin-top: 10px;
  color: #b91c1c;
  font-weight: 600;
}

.password-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #14525c 0%, #1c6a77 100%);
  color: #ffffff;
  cursor: help;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.password-hint svg {
  width: 16px;
  height: 16px;
}

.user-restaurants {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.user-restaurants__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.user-restaurants__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.restaurant-adder {
  display: flex;
  align-items: center;
  gap: 8px;
}

.restaurant-adder__input {
  position: relative;
  min-width: 240px;
}

#restaurantSearchInput {
  width: 100%;
}

#restaurantSuggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

#restaurantSuggestions.show {
  display: block;
}

.restaurant-list.list-group {
  margin-top: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}
