/* Global typography and shared layout styles */
:root {
  --app-font-sans: "Roboto", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Arial, "Noto Sans", "Liberation Sans", sans-serif;

  /* Brand (Laptop24h) */
  --brand-accent: #fd8b00;
  --brand-primary: #003366;

  /* Light theme tokens */
  --bg: #f7fafc;
  --surface: #ffffff;
  --surface-2: #f1f4f6;
  --surface-lowest: #ffffff;
  --text: #181c1e;
  --text-muted: #43474f;
  --border: #c3c6d1;

  --nav-hover: #e0e3e5;
  --danger: #ef4444;
}



html,
body {
  font-family: var(--app-font-sans);
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* Desktop mobile top bar hidden */
.mobile-top-bar {
  display: none;
}

/* Shared sidebar styles used by views/partials/sidebar.ejs */
.sidebar {
  --bg: #0b1220;
  --surface: #0f172a;
  --surface-2: #111c2c;
  --surface-lowest: #090d16;
  --text: #eef1f3;
  --text-muted: #a9b2bf;
  --border: #243144;
  --nav-hover: rgba(255, 255, 255, 0.06);
  --danger: #fb7185;

  position: fixed;
  left: 0;
  top: 0;
  width: 260px;
  height: 100vh;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
}

/* Mobile responsive sidebar (off-canvas) & Top Bar */
@media (max-width: 767.98px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }

  .sidebar.sidebar--open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 35;
    display: none;
  }

  .sidebar-backdrop.sidebar-backdrop--show {
    display: block;
  }

  .mobile-top-bar {
    --bg: #0b1220;
    --surface: #0f172a;
    --surface-2: #111c2c;
    --surface-lowest: #090d16;
    --text: #eef1f3;
    --text-muted: #a9b2bf;
    --border: #243144;
    --nav-hover: rgba(255, 255, 255, 0.06);
    --danger: #fb7185;

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 45;
    gap: 12px;
  }

  .mobile-top-bar-toggle {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s;
  }

  .mobile-top-bar-toggle:active {
    background: var(--nav-hover);
  }

  .mobile-top-bar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-top-bar-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
  }

  .mobile-top-bar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
  }

  /* Shift main content down on mobile to clear the sticky top bar */
  main {
    margin-top: 56px !important;
  }
}

.sidebar-header {
  padding: 0 24px;
  margin-bottom: 32px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  background: var(--brand-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-brand-text {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-brand-text small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 0 12px;
  flex: 1;
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  padding: 8px 12px;
  margin-top: 16px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--nav-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--surface);
  color: var(--brand-accent);
  border-left: 4px solid var(--brand-accent);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--brand-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-footer .btn {
  display: inline-flex;
  align-items: center;
  width: 100%;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  border-radius: 6px;
  color: var(--danger);
  background: transparent;
  text-decoration: none;
  font-size: 12px;
}

.sidebar-footer .btn:hover {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}
