/* ==========================================================================
   VICREO Werkregistratie — design system
   Palette derived from the app icon: near-black + magenta + cyan.
   Bootstrap 5.3 is still doing the heavy lifting; this file layers brand
   tokens on top via Bootstrap's CSS-variable API and restyles the
   sidebar/topbar app shell.
   ========================================================================== */

:root {
  --brand-dark: #111114;
  --brand-dark-2: #1b1b21;
  --brand-pink: #e6007e;
  --brand-pink-dark: #b90067;
  --brand-cyan: #00aeef;

  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e3e5ea;
  --text: #16161a;
  --text-muted: #6b7280;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 16, 20, 0.06), 0 1px 1px rgba(16, 16, 20, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 16, 20, 0.10);

  --sidebar-width: 240px;
  --topbar-height: 56px;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-pink-dark);
}

/* ==========================================================================
   App shell: sidebar (desktop) + topbar (mobile/tablet)
   ========================================================================== */

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}

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

@media (min-width: 992px) {
  .app-sidebar {
    transform: translateX(0);
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}

.sidebar-brand:hover {
  color: #fff;
}

.sidebar-brand img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  flex-shrink: 0;
}

.sidebar-brand-sub {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.02em;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 12px;
  flex: 1 1 auto;
  overflow-y: auto;
}

.sidebar-nav li + li {
  margin-top: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.sidebar-link.active {
  background: linear-gradient(
    90deg,
    rgba(230, 0, 126, 0.28),
    rgba(0, 174, 239, 0.12)
  );
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand-pink);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-footer #userInfo {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer .btn {
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-padding-x: 0.5rem;
  --bs-btn-font-size: 0.78rem;
  flex-shrink: 0;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.45);
  z-index: 1035;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 992px) {
  .sidebar-backdrop {
    display: none;
  }
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-height);
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1020;
}

@media (min-width: 992px) {
  .topbar {
    display: none;
  }
}

.sidebar-toggle {
  border: none;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  padding: 4px 8px;
  color: var(--text);
  border-radius: var(--radius-sm);
}

.sidebar-toggle:hover {
  background: var(--bg);
}

.topbar-brand {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
}

.app-main {
  min-height: 100%;
}

@media (min-width: 992px) {
  .app-main {
    margin-left: var(--sidebar-width);
  }
}

.page-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

@media (min-width: 768px) {
  .page-container {
    padding: 32px 40px 72px;
  }
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

/* Forms and standalone "form-like" info cards stay a comfortable reading
   width even on a wide desktop screen; tables/lists use the full width. */
.page-form {
  max-width: 640px;
}

/* ==========================================================================
   Bootstrap component re-skin (kept compatible with existing utility
   classes already used across the pages, e.g. bg-light/border/rounded)
   ========================================================================== */

.bg-light {
  background-color: var(--surface) !important;
}

.border {
  border-color: var(--border) !important;
}

.rounded {
  border-radius: var(--radius) !important;
}

.shadow-sm {
  box-shadow: var(--shadow-sm) !important;
}

.card {
  border-color: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-header {
  background-color: var(--surface);
  border-bottom-color: var(--border);
  font-weight: 600;
}

.btn {
  font-weight: 600;
  text-transform: none;
  border-radius: var(--radius-sm);
}

.btn-primary {
  --bs-btn-bg: var(--brand-pink);
  --bs-btn-border-color: var(--brand-pink);
  --bs-btn-hover-bg: var(--brand-pink-dark);
  --bs-btn-hover-border-color: var(--brand-pink-dark);
  --bs-btn-active-bg: var(--brand-pink-dark);
  --bs-btn-active-border-color: var(--brand-pink-dark);
  --bs-btn-focus-shadow-rgb: 230, 0, 126;
}

.btn-outline-info {
  --bs-btn-color: var(--brand-cyan);
  --bs-btn-border-color: var(--brand-cyan);
  --bs-btn-hover-bg: var(--brand-cyan);
  --bs-btn-hover-border-color: var(--brand-cyan);
}

.form-control,
.form-select {
  font-size: 16px;
  border-radius: var(--radius-sm);
  border-color: var(--border);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 0.2rem rgba(0, 174, 239, 0.18);
}

.form-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}

.table-responsive {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table {
  margin-bottom: 0;
}

.table-dark {
  --bs-table-bg: var(--brand-dark);
  --bs-table-color: #fff;
  --bs-table-border-color: var(--brand-dark-2);
}

.list-group-item {
  border-color: var(--border);
}

.list-group {
  border-radius: var(--radius);
  overflow: hidden;
}

.invoiced-row {
  --bs-table-accent-bg: #e6f7fd !important;
}

/* ==========================================================================
   Page-specific bits carried over from the previous stylesheet
   ========================================================================== */

/* Custom styling for week selector */
#week-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-bottom: 15px;
}

#week-selector button {
  background-color: var(--brand-pink);
  color: white;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 16px;
  border-radius: var(--radius-sm);
}

/* Weekday selection */
#week-days {
  display: flex;
  gap: 5px;
}

.week-day {
  background-color: var(--bg);
  border: 1px solid var(--border);
  padding: 5px 10px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.week-day.selected {
  background-color: var(--brand-pink);
  color: white;
  font-weight: bold;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 300px;
}

.favorite-icon {
  position: absolute;
  right: 10px;
  cursor: pointer;
  font-size: 20px;
  color: #ffd700;
  transition: transform 0.2s;
}

.favorite-icon:hover {
  transform: scale(1.2);
}

#date-scroll-container {
  overflow-x: auto;
  white-space: nowrap;
  width: 100%;
  padding: 10px 0;
}

#date-scroll button {
  display: inline-block;
  padding: 10px 15px;
  margin: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  border-radius: var(--radius-sm);
  min-width: 60px;
}

#date-scroll button.active {
  background: var(--brand-pink);
  border-color: var(--brand-pink);
  color: white;
  font-weight: bold;
}

#week-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

#week-controls button {
  padding: 5px 10px;
  cursor: pointer;
}

/* Make suggestion list appear over other content and match input width */
.position-relative .list-group {
  top: 100%;
  left: 0;
  max-height: 200px;
  overflow-y: auto;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.position-relative .list-group {
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Invoice button styling with fallback */
.invoice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
}

.invoice-btn .bi::before {
  content: "📄";
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

@supports (font-family: "bootstrap-icons") {
  .invoice-btn .bi::before {
    content: "";
  }
}

#chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
