/*
 * IT4Professionals administratieplatform - stijlen
 *
 * Opbouw:
 *  1. Variabelen
 *  2. Basis
 *  3. Layout (topbalk, menu, inhoud)
 *  4. Componenten (knoppen, kaarten, tabellen, formulieren, meldingen, labels)
 *  5. Pagina-specifiek
 *  6. Responsive
 */

/* ==========================================================================
   1. Variabelen
   ========================================================================== */

:root
{
   --color-bg: #f4f6f9;
   --color-surface: #ffffff;
   --color-border: #dde2ea;
   --color-text: #1f2733;
   --color-muted: #6b7686;
   --color-primary: #1c5fa8;
   --color-primary-dark: #154a84;
   --color-sidebar: #18253a;
   --color-sidebar-text: #c5cfdd;

   --color-green: #1e8a4c;
   --color-green-bg: #e5f5ec;
   --color-orange: #b8660b;
   --color-orange-bg: #fdf1e2;
   --color-red: #c0392b;
   --color-red-bg: #fbe9e7;
   --color-blue-bg: #e7f0fb;

   --radius: 6px;
   --shadow: 0 1px 2px rgba(20, 30, 50, 0.06);
   --sidebar-width: 220px;
   --topbar-height: 52px;
   --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
   --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ==========================================================================
   2. Basis
   ========================================================================== */

*,
*::before,
*::after
{
   box-sizing: border-box;
}

html
{
   font-size: 15px;
}

body
{
   margin: 0;
   font-family: var(--font);
   color: var(--color-text);
   background: var(--color-bg);
   line-height: 1.5;
}

a
{
   color: var(--color-primary);
   text-decoration: none;
}

a:hover
{
   text-decoration: underline;
}

h1
{
   font-size: 1.6rem;
   margin: 0 0 0.25rem;
   font-weight: 600;
}

h2
{
   font-size: 1.1rem;
   margin: 0 0 0.75rem;
   font-weight: 600;
}

code
{
   font-family: var(--font-mono);
   font-size: 0.9em;
   background: #eef1f5;
   padding: 0.1em 0.35em;
   border-radius: 3px;
}

.muted
{
   color: var(--color-muted);
}

.small
{
   font-size: 0.85rem;
}

.nowrap
{
   white-space: nowrap;
}

/* ==========================================================================
   3. Layout
   ========================================================================== */

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

.brand
{
   font-weight: 700;
   font-size: 1.05rem;
   color: var(--color-text);
}

.topbar-right
{
   margin-left: auto;
   display: flex;
   align-items: center;
   gap: 0.75rem;
}

.user-link
{
   color: var(--color-text);
   font-weight: 500;
}

.menu-toggle
{
   display: none;
   flex-direction: column;
   justify-content: center;
   gap: 4px;
   width: 36px;
   height: 36px;
   padding: 6px;
   border: 0;
   background: transparent;
   cursor: pointer;
}

.menu-toggle span
{
   display: block;
   height: 2px;
   background: var(--color-text);
   border-radius: 2px;
}

.shell
{
   display: flex;
   min-height: calc(100vh - var(--topbar-height));
}

.sidebar
{
   flex: 0 0 var(--sidebar-width);
   background: var(--color-sidebar);
   padding: 1rem 0;
   position: relative;
}

.sidebar ul
{
   list-style: none;
   margin: 0;
   padding: 0;
}

.nav-link
{
   display: block;
   padding: 0.5rem 1.25rem;
   color: var(--color-sidebar-text);
   border-left: 3px solid transparent;
}

a.nav-link:hover
{
   background: rgba(255, 255, 255, 0.05);
   color: #ffffff;
   text-decoration: none;
}

.nav-link.is-active
{
   color: #ffffff;
   background: rgba(255, 255, 255, 0.08);
   border-left-color: #5fa2ec;
}

.nav-link.is-disabled
{
   opacity: 0.4;
   cursor: default;
}

.nav-link small
{
   float: right;
   font-size: 0.7rem;
}

.nav-section
{
   margin: 1.25rem 1.25rem 0.25rem;
   font-size: 0.75rem;
   text-transform: uppercase;
   letter-spacing: 0.05em;
   color: #7c8aa0;
}

.nav-version
{
   margin: 1.5rem 1.25rem 0;
   font-size: 0.75rem;
   color: #5d6b80;
}

.main
{
   flex: 1;
   min-width: 0;
   padding: 1.5rem 2rem 3rem;
   max-width: 1400px;
}

/* ==========================================================================
   4. Componenten
   ========================================================================== */

/* Knoppen ------------------------------------------------------------------ */

.btn
{
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 0.35rem;
   padding: 0.45rem 0.9rem;
   font: inherit;
   font-weight: 500;
   color: var(--color-text);
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   cursor: pointer;
   text-decoration: none;
   white-space: nowrap;
}

.btn:hover
{
   background: #f0f3f7;
   text-decoration: none;
}

.btn-primary
{
   color: #ffffff;
   background: var(--color-primary);
   border-color: var(--color-primary);
}

.btn-primary:hover
{
   background: var(--color-primary-dark);
}

.btn-ghost
{
   background: transparent;
}

.btn-small
{
   padding: 0.25rem 0.6rem;
   font-size: 0.875rem;
}

.btn-block
{
   width: 100%;
}

.inline-form
{
   display: inline;
   margin: 0;
}

/* Kaarten ------------------------------------------------------------------ */

.card
{
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   box-shadow: var(--shadow);
   padding: 1.25rem;
   margin-bottom: 1.25rem;
}

.card-flush
{
   padding: 0;
   overflow-x: auto;
}

.card-muted
{
   background: #f9fafc;
   color: var(--color-muted);
}

.grid-2
{
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 1.25rem;
}

.grid-2 > .card
{
   margin-bottom: 0;
}

.grid-2 + *
{
   margin-top: 1.25rem;
}

/* Paginakop ---------------------------------------------------------------- */

.page-header
{
   display: flex;
   align-items: flex-start;
   justify-content: space-between;
   gap: 1rem;
   margin-bottom: 1.25rem;
   flex-wrap: wrap;
}

.page-header .actions
{
   display: flex;
   gap: 0.5rem;
   flex-wrap: wrap;
}

.count
{
   font-size: 1rem;
   font-weight: 500;
   color: var(--color-muted);
   margin-left: 0.25rem;
}

.back-link
{
   font-size: 0.875rem;
   color: var(--color-muted);
}

/* Tabellen ----------------------------------------------------------------- */

.table
{
   width: 100%;
   border-collapse: collapse;
}

.table th,
.table td
{
   padding: 0.6rem 0.9rem;
   text-align: left;
   border-bottom: 1px solid var(--color-border);
   vertical-align: top;
}

.table th
{
   font-size: 0.8rem;
   font-weight: 600;
   text-transform: uppercase;
   letter-spacing: 0.03em;
   color: var(--color-muted);
   background: #f9fafc;
}

.table tbody tr:last-child td
{
   border-bottom: 0;
}

.table-hover tbody tr:hover
{
   background: #f7f9fc;
}

.table tr.is-archived td
{
   color: var(--color-muted);
}

/* Formulieren -------------------------------------------------------------- */

.form fieldset
{
   border: 0;
   padding: 0;
   margin: 0 0 1.5rem;
}

.form legend
{
   font-weight: 600;
   font-size: 1rem;
   margin-bottom: 0.75rem;
   padding: 0;
}

.field
{
   margin-bottom: 1rem;
   flex: 1;
}

.field label,
.field .label
{
   display: block;
   font-weight: 500;
   margin-bottom: 0.3rem;
}

.field-row
{
   display: flex;
   gap: 1rem;
}

.field-small
{
   flex: 0 0 120px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea
{
   width: 100%;
   padding: 0.5rem 0.65rem;
   font: inherit;
   color: var(--color-text);
   background: #ffffff;
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
}

input:focus,
select:focus,
textarea:focus
{
   outline: 2px solid rgba(28, 95, 168, 0.25);
   border-color: var(--color-primary);
}

textarea
{
   resize: vertical;
}

.checkbox
{
   display: flex;
   align-items: center;
   gap: 0.5rem;
   margin-bottom: 0.5rem;
   font-weight: 400;
   cursor: pointer;
}

.field .checkbox
{
   font-weight: 400;
}

.hint
{
   font-size: 0.85rem;
   color: var(--color-muted);
   margin-top: 0.25rem;
}

.has-error input,
.has-error select,
.has-error textarea
{
   border-color: var(--color-red);
}

.field-error
{
   color: var(--color-red);
   font-size: 0.85rem;
   margin-top: 0.25rem;
}

.form-actions
{
   display: flex;
   gap: 0.5rem;
}

/* Filters ------------------------------------------------------------------ */

.filters
{
   display: flex;
   flex-wrap: wrap;
   gap: 0.5rem;
   align-items: center;
   margin-bottom: 1rem;
}

.filters select
{
   width: auto;
}

.filter-search
{
   flex: 1 1 260px;
}

.segmented
{
   display: inline-flex;
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   overflow: hidden;
   background: var(--color-surface);
}

.segmented a
{
   padding: 0.45rem 0.8rem;
   color: var(--color-text);
   border-right: 1px solid var(--color-border);
}

.segmented a:last-child
{
   border-right: 0;
}

.segmented a:hover
{
   background: #f0f3f7;
   text-decoration: none;
}

.segmented a.is-active
{
   background: var(--color-primary);
   color: #ffffff;
}

.pagination
{
   display: flex;
   gap: 1rem;
   align-items: center;
   justify-content: center;
}

/* Meldingen ---------------------------------------------------------------- */

.alert
{
   padding: 0.75rem 1rem;
   border-radius: var(--radius);
   margin-bottom: 1rem;
   border: 1px solid transparent;
}

.alert-success
{
   background: var(--color-green-bg);
   border-color: #b9e2c9;
   color: #145c33;
}

.alert-error
{
   background: var(--color-red-bg);
   border-color: #f1c2bc;
   color: #8e271c;
}

.alert-warning
{
   background: var(--color-orange-bg);
   border-color: #f3d3a9;
   color: #7d4505;
}

.alert-info
{
   background: var(--color-blue-bg);
   border-color: #c3d7f1;
   color: #1b4a80;
}

.memo
{
   background: #fff8db;
   border: 1px solid #f0dc8a;
   border-left: 4px solid #e0b500;
   border-radius: var(--radius);
   padding: 0.75rem 1rem;
   margin-bottom: 1.25rem;
}

/* Labels ------------------------------------------------------------------- */

.badge
{
   display: inline-block;
   padding: 0.1rem 0.5rem;
   margin-right: 0.25rem;
   font-size: 0.75rem;
   font-weight: 600;
   border-radius: 999px;
   white-space: nowrap;
}

.badge-client
{
   background: var(--color-blue-bg);
   color: #1b4a80;
}

.badge-reseller
{
   background: #efe7fb;
   color: #5a2d91;
}

.badge-own
{
   background: #e8ecf1;
   color: #3b4656;
}

.badge-archived
{
   background: #eeeeee;
   color: #777777;
}

/* Detaillijst -------------------------------------------------------------- */

.details
{
   display: grid;
   grid-template-columns: 140px 1fr;
   gap: 0.5rem 1rem;
   margin: 0;
}

.details dt
{
   color: var(--color-muted);
}

.details dd
{
   margin: 0;
}

.meta
{
   font-size: 0.85rem;
   color: var(--color-muted);
   margin-top: 1rem;
}

/* ==========================================================================
   5. Pagina-specifiek
   ========================================================================== */

/* Overzicht */

.stats
{
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
   gap: 1rem;
   margin-bottom: 1.25rem;
}

.stat
{
   display: flex;
   flex-direction: column;
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   padding: 1rem 1.25rem;
   color: var(--color-text);
   box-shadow: var(--shadow);
}

.stat:hover
{
   border-color: var(--color-primary);
   text-decoration: none;
}

.stat-value
{
   font-size: 1.8rem;
   font-weight: 700;
}

.stat-label
{
   color: var(--color-muted);
}

/* Login, installatie */

.auth-body
{
   display: flex;
   align-items: flex-start;
   justify-content: center;
   min-height: 100vh;
   padding: 8vh 1rem 2rem;
}

.auth-card
{
   width: 100%;
   max-width: 420px;
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: 10px;
   box-shadow: 0 4px 16px rgba(20, 30, 50, 0.08);
   padding: 2rem;
}

.auth-brand
{
   font-weight: 700;
   color: var(--color-primary);
   margin-bottom: 1.25rem;
}

.steps li
{
   margin-bottom: 0.5rem;
}

/* Foutpagina's */

.error-page
{
   max-width: 520px;
}

/* Algemene aanvullingen (v0.2) ----------------------------------------------- */

[hidden]
{
   display: none !important;
}

.card-header
{
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 1rem;
   padding: 1rem 1.25rem 0.5rem;
}

.card-header h2
{
   margin: 0;
}

.card-body
{
   padding: 0 1.25rem 1rem;
   margin: 0;
}

.form-narrow
{
   max-width: 720px;
}

.form-inline
{
   display: flex;
   flex-wrap: wrap;
   gap: 1rem;
   align-items: flex-end;
}

.form-inline .field
{
   margin-bottom: 0;
   flex: 0 1 260px;
}

.table .num,
.table-numbers .num
{
   text-align: right;
   white-space: nowrap;
   font-variant-numeric: tabular-nums;
}

.table-compact th,
.table-compact td
{
   padding: 0.35rem 0.6rem;
   font-size: 0.9rem;
}

.table-scroll
{
   overflow-x: auto;
}

.actions-cell
{
   text-align: right;
   white-space: nowrap;
}

.check-cell
{
   width: 2rem;
}

.input-small
{
   max-width: 220px;
}

.input-tiny
{
   max-width: 90px;
}

.input-prefix
{
   display: flex;
   align-items: stretch;
}

.input-prefix span
{
   display: flex;
   align-items: center;
   padding: 0 0.6rem;
   background: #eef1f5;
   border: 1px solid var(--color-border);
   border-right: 0;
   border-radius: var(--radius) 0 0 var(--radius);
   color: var(--color-muted);
}

.input-prefix input
{
   border-radius: 0 var(--radius) var(--radius) 0;
}

.tabs
{
   display: flex;
   gap: 0.5rem;
   margin-bottom: 1rem;
   flex-wrap: wrap;
}

.tabs a
{
   padding: 0.35rem 0.8rem;
   border: 1px solid var(--color-border);
   border-radius: 999px;
   background: var(--color-surface);
   color: var(--color-text);
}

.legend
{
   margin: -0.25rem 0 0.75rem;
}

.sticky-actions
{
   position: sticky;
   bottom: 0;
   padding: 0.75rem 0;
   background: var(--color-bg);
   z-index: 5;
}

/* Labels voor status en urgentie */

.badge-warning
{
   background: var(--color-orange-bg);
   color: var(--color-orange);
}

.badge-danger
{
   background: var(--color-red);
   color: #ffffff;
}

.pill
{
   display: inline-block;
   padding: 0.1rem 0.55rem;
   border-radius: 999px;
   font-size: 0.85rem;
   font-weight: 600;
   white-space: nowrap;
   font-variant-numeric: tabular-nums;
}

.pill-later
{
   background: #eef1f5;
   color: var(--color-muted);
}

.pill-groen
{
   background: var(--color-green-bg);
   color: var(--color-green);
}

.pill-oranje
{
   background: var(--color-orange-bg);
   color: var(--color-orange);
}

.pill-rood
{
   background: var(--color-red-bg);
   color: var(--color-red);
}

.status
{
   display: inline-block;
   padding: 0.05rem 0.5rem;
   border-radius: 4px;
   font-size: 0.85rem;
   margin-right: 0.25rem;
}

.status-gefactureerd
{
   background: var(--color-green-bg);
   color: var(--color-green);
}

.status-gratis
{
   background: var(--color-blue-bg);
   color: #1b4a80;
}

.status-niet_aangerekend
{
   background: #f1eef8;
   color: #5a4a7a;
}

.status-stopgezet
{
   background: #eeeeee;
   color: #666666;
}

.stats-small .stat
{
   padding: 0.6rem 0.9rem;
}

.stats-small .stat-value
{
   font-size: 1.4rem;
}

.stat-groen
{
   border-left: 4px solid var(--color-green);
}

.stat-oranje
{
   border-left: 4px solid var(--color-orange);
}

.stat-rood,
.stat-danger
{
   border-left: 4px solid var(--color-red);
}

/* Domeinnamen */

.open-periods
{
   list-style: none;
   padding: 0;
   margin: 0 0 1rem;
}

.open-periods li
{
   margin-bottom: 0.35rem;
}

.register-period
{
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   padding: 0.75rem 1rem;
   background: #fafbfd;
}

.register-period summary
{
   cursor: pointer;
   font-weight: 600;
}

.register-period form
{
   margin-top: 1rem;
}

.bulk-bar
{
   position: sticky;
   top: var(--topbar-height);
   z-index: 6;
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 0.75rem;
   padding: 0.6rem 1rem;
   margin-bottom: 0.75rem;
   background: var(--color-blue-bg);
   border: 1px solid #c3d7f1;
   border-radius: var(--radius);
}

.bulk-bar .picker
{
   flex: 0 1 320px;
}

/* Relatiekiezer */

.picker
{
   position: relative;
}

.picker input[type="text"]
{
   padding-right: 2rem;
}

.picker.has-value input[type="text"]
{
   border-color: var(--color-green);
   background: #f6fbf8;
}

.picker-clear
{
   position: absolute;
   right: 0.4rem;
   top: 50%;
   transform: translateY(-50%);
   border: 0;
   background: transparent;
   color: var(--color-muted);
   font-size: 1.1rem;
   cursor: pointer;
   line-height: 1;
}

.picker-results
{
   position: absolute;
   left: 0;
   right: 0;
   top: 100%;
   z-index: 30;
   max-height: 280px;
   overflow-y: auto;
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   box-shadow: 0 6px 18px rgba(20, 30, 50, 0.12);
}

.picker-option
{
   display: block;
   width: 100%;
   padding: 0.45rem 0.7rem;
   text-align: left;
   font: inherit;
   background: transparent;
   border: 0;
   border-bottom: 1px solid #f0f2f5;
   cursor: pointer;
}

.picker-option:hover
{
   background: var(--color-blue-bg);
}

.picker-empty
{
   padding: 0.5rem 0.7rem;
   color: var(--color-muted);
}

/* Import-wizard */

.wizard-steps
{
   display: flex;
   flex-wrap: wrap;
   gap: 0.25rem;
   list-style: none;
   padding: 0;
   margin: 0 0 1.25rem;
}

.wizard-steps li
{
   padding: 0.4rem 0.9rem;
   border-radius: 999px;
   background: #e8ecf1;
   color: var(--color-muted);
   font-size: 0.9rem;
}

.wizard-steps li.is-done
{
   background: var(--color-green-bg);
}

.wizard-steps li.is-done a
{
   color: var(--color-green);
}

.wizard-steps li.is-current
{
   background: var(--color-primary);
   color: #ffffff;
   font-weight: 600;
}

.grid-fields
{
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
   gap: 0 1rem;
}

.year-grid
{
   display: flex;
   flex-wrap: wrap;
   gap: 0.25rem 1rem;
   margin-bottom: 1rem;
}

.group-title
{
   display: flex;
   align-items: center;
   gap: 0.75rem;
   font-size: 1rem;
   margin: 1rem 1.25rem 0.5rem;
}

tr.needs-attention td
{
   background: var(--color-orange-bg);
}

tr.is-resolved td:first-child
{
   border-left: 3px solid var(--color-green);
}

select.is-empty
{
   border-color: var(--color-orange);
}

/* ==========================================================================
   6. Responsive
   ========================================================================== */

@media (max-width: 900px)
{
   .grid-2
   {
      grid-template-columns: 1fr;
   }
}

@media (max-width: 768px)
{
   .menu-toggle
   {
      display: flex;
   }

   .sidebar
   {
      position: fixed;
      top: var(--topbar-height);
      left: 0;
      bottom: 0;
      width: 260px;
      z-index: 15;
      transform: translateX(-100%);
      transition: transform 0.2s ease;
      overflow-y: auto;
   }

   .sidebar.is-open
   {
      transform: translateX(0);
      box-shadow: 4px 0 16px rgba(0, 0, 0, 0.2);
   }

   .main
   {
      padding: 1rem;
   }

   .hide-mobile
   {
      display: none;
   }

   .field-row
   {
      flex-direction: column;
      gap: 0;
   }

   .field-small
   {
      flex: 1;
   }

   .details
   {
      grid-template-columns: 1fr;
      gap: 0.1rem;
   }

   .details dd
   {
      margin-bottom: 0.5rem;
   }

   .user-link
   {
      display: none;
   }
}
