/* =============================================================================
   Fiberlinq Backup Portal - design system
   Tokens 1:1 overgenomen uit https://fiberlinq.nl/assets/css/style.css
   ============================================================================= */

@import url('/static/css/fonts.css');

:root {
    /* Merkkleuren */
    --fl-blue:        #124272;   /* header / footer / headings */
    --fl-blue-dark:   #0d3159;
    --fl-blue-light:  #1b5a95;
    --fl-navy:        #191970;   /* link hover */
    --fl-orange:      #FF6B18;   /* primaire actiekleur */
    --fl-orange-alt:  #EC652B;   /* topbar */
    --fl-link:        #0274be;

    /* Neutraal */
    --fl-text:        #54595F;
    --fl-muted:       #7A7A7A;
    --fl-heading:     #124272;
    --fl-bg:          #F7F9FC;
    --fl-surface:     #FFFFFF;
    --fl-border:      #E5E9EF;
    --fl-border-2:    #D5D8DC;

    /* Status */
    --fl-ok:          #1e8e5a;
    --fl-ok-bg:       #e8f6ef;
    --fl-warn:        #b7791f;
    --fl-warn-bg:     #fdf5e5;
    --fl-err:         #c0392b;
    --fl-err-bg:      #fbeceb;
    --fl-info:        #0274be;
    --fl-info-bg:     #e9f3fb;

    /* Vorm */
    --fl-r-card:      14px;
    --fl-r-input:     6px;
    --fl-r-pill:      30px;
    --fl-shadow:      0 2px 10px -4px rgba(18, 66, 114, 0.08);
    --fl-shadow-hi:   0 15px 35px -12px rgba(18, 66, 114, 0.25);

    --fl-sidebar-w:   250px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Roboto', system-ui, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    color: var(--fl-text);
    background: var(--fl-bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Barlow', system-ui, sans-serif;
    color: var(--fl-heading);
    line-height: 1.2;
}

h1 { font-weight: 600; font-size: 30px; }
h2 { font-weight: 700; font-size: 22px; }
h3 { font-weight: 600; font-size: 18px; }
h4 { font-weight: 600; font-size: 15px; }

a { color: var(--fl-link); text-decoration: none; transition: color .2s; }
a:hover { color: var(--fl-navy); }

img, svg { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

code, .mono {
    font-family: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;
    font-size: .875em;
}

/* =============================================================================
   Layout
   ============================================================================= */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--fl-sidebar-w);
    flex: 0 0 var(--fl-sidebar-w);
    background: var(--fl-blue);
    color: rgba(255, 255, 255, .8);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.sidebar-brand img { height: 34px; }
.sidebar-brand .product {
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--fl-orange);
    margin-top: 10px;
}

.sidebar-nav { padding: 14px 0; flex: 1; overflow-y: auto; }
.sidebar-nav .nav-section {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .45);
    padding: 16px 20px 6px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: rgba(255, 255, 255, .82);
    font-size: 15px;
    border-left: 3px solid transparent;
    transition: background .18s, color .18s, border-color .18s;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-nav a.active {
    background: rgba(255, 107, 24, .14);
    border-left-color: var(--fl-orange);
    color: #fff;
    font-weight: 500;
}
.sidebar-nav a svg { width: 18px; height: 18px; fill: currentColor; flex: 0 0 18px; }

.sidebar-foot {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: 12px;
    color: rgba(255, 255, 255, .55);
}
.sidebar-foot a { color: rgba(255, 255, 255, .8); }
.sidebar-foot a:hover { color: var(--fl-orange); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: var(--fl-orange-alt);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    padding: 7px 28px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 24px;
}
.topbar a, .topbar span { color: #fff; display: flex; align-items: center; gap: 6px; }
.topbar a:hover { opacity: .85; color: #fff; }
.topbar svg { width: 14px; height: 14px; fill: #fff; }

.page-head {
    background: var(--fl-surface);
    border-bottom: 1px solid var(--fl-border);
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.page-head .eyebrow {
    display: block;
    color: var(--fl-orange);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.page-head .actions { display: flex; gap: 10px; align-items: center; }

.content { padding: 26px 28px 60px; flex: 1; }

/* =============================================================================
   Cards & grid
   ============================================================================= */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
    background: var(--fl-surface);
    border: 1px solid var(--fl-border);
    border-radius: var(--fl-r-card);
    box-shadow: var(--fl-shadow);
    overflow: hidden;
}
.card-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--fl-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.card-head h3 { margin: 0; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }

/* Stat-tegels */
.stat {
    background: var(--fl-surface);
    border: 1px solid var(--fl-border);
    border-radius: var(--fl-r-card);
    box-shadow: var(--fl-shadow);
    padding: 18px 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: transform .25s ease, box-shadow .25s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--fl-shadow-hi); }
.stat-icon {
    width: 42px; height: 42px;
    flex: 0 0 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 107, 24, .1);
}
.stat-icon svg { width: 21px; height: 21px; fill: var(--fl-orange); }
.stat-icon.blue { background: rgba(18, 66, 114, .08); }
.stat-icon.blue svg { fill: var(--fl-blue); }
.stat-label {
    font-size: 12px; font-weight: 700; letter-spacing: 1.4px;
    text-transform: uppercase; color: var(--fl-muted);
}
.stat-value {
    font-family: 'Barlow', sans-serif;
    font-size: 27px; font-weight: 700; color: var(--fl-heading);
    line-height: 1.15; margin-top: 2px;
}
.stat-sub { font-size: 13px; color: var(--fl-muted); }

/* Voortgangsbalk */
.bar { height: 8px; border-radius: 20px; background: var(--fl-border); overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; border-radius: 20px; background: var(--fl-orange); transition: width .4s ease; }
.bar.ok > span   { background: var(--fl-ok); }
.bar.warn > span { background: var(--fl-warn); }
.bar.err > span  { background: var(--fl-err); }

/* =============================================================================
   Tabellen
   ============================================================================= */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th {
    text-align: left;
    font-family: 'Barlow', sans-serif;
    font-size: 12px; font-weight: 700; letter-spacing: 1.2px;
    text-transform: uppercase; color: var(--fl-muted);
    padding: 12px 20px;
    border-bottom: 1px solid var(--fl-border);
    background: #FAFBFD;
    white-space: nowrap;
}
table.tbl td { padding: 13px 20px; border-bottom: 1px solid var(--fl-border); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: #FAFBFD; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t-strong { color: var(--fl-heading); font-weight: 500; }
.t-muted { color: var(--fl-muted); font-size: 13px; }

.empty { padding: 46px 20px; text-align: center; color: var(--fl-muted); }
.empty svg { width: 46px; height: 46px; fill: var(--fl-border-2); margin: 0 auto 14px; }
.empty h3 { color: var(--fl-muted); font-weight: 600; margin-bottom: 6px; }

/* =============================================================================
   Badges
   ============================================================================= */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: var(--fl-r-pill);
    font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
    white-space: nowrap;
}
.badge.ok   { background: var(--fl-ok-bg);   color: var(--fl-ok); }
.badge.warn { background: var(--fl-warn-bg); color: var(--fl-warn); }
.badge.err  { background: var(--fl-err-bg);  color: var(--fl-err); }
.badge.info { background: var(--fl-info-bg); color: var(--fl-info); }
.badge.idle { background: #F3F3F3;           color: var(--fl-muted); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge .dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* =============================================================================
   Knoppen & formulieren
   ============================================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--fl-orange); color: #fff;
    padding: 11px 26px; border: none; border-radius: var(--fl-r-pill);
    font-family: 'Roboto', sans-serif; font-size: 15px; font-weight: 500;
    cursor: pointer; transition: background-color .2s, box-shadow .2s;
    white-space: nowrap; text-align: center;
}
.btn:hover { background: var(--fl-blue); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }

.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--fl-blue); border: 1px solid var(--fl-border-2); }
.btn-ghost:hover { background: var(--fl-blue); color: #fff; border-color: var(--fl-blue); }
.btn-danger { background: var(--fl-err); }
.btn-danger:hover { background: #8e2b20; }

.field { margin-bottom: 16px; }
.field label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--fl-heading); margin-bottom: 6px;
}
.field .hint { font-size: 12px; color: var(--fl-muted); margin-top: 5px; }

input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--fl-border-2);
    border-radius: var(--fl-r-input);
    font-family: 'Roboto', sans-serif; font-size: 15px; color: var(--fl-text);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--fl-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 24, .15);
}

/* =============================================================================
   Meldingen
   ============================================================================= */
.alert {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 18px; border-radius: 10px;
    margin-bottom: 18px; font-size: 14px;
    border: 1px solid transparent;
}
.alert svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; fill: currentColor; }
.alert.ok   { background: var(--fl-ok-bg);   color: var(--fl-ok);   border-color: rgba(30, 142, 90, .25); }
.alert.err  { background: var(--fl-err-bg);  color: var(--fl-err);  border-color: rgba(192, 57, 43, .25); }
.alert.warn { background: var(--fl-warn-bg); color: var(--fl-warn); border-color: rgba(183, 121, 31, .25); }
.alert.info { background: var(--fl-info-bg); color: var(--fl-info); border-color: rgba(2, 116, 190, .25); }

/* =============================================================================
   Login
   ============================================================================= */
.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(150deg, var(--fl-blue) 0%, var(--fl-blue-dark) 55%, #081f3b 100%);
    padding: 24px;
}
.login-card {
    width: 100%; max-width: 400px;
    background: #fff;
    border-radius: var(--fl-r-card);
    box-shadow: 0 20px 50px -15px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .2);
    overflow: hidden;
}
.login-card .head {
    background: var(--fl-blue);
    padding: 30px 32px 26px;
    text-align: center;
}
.login-card .head img { height: 38px; margin: 0 auto 14px; }
.login-card .head .product {
    font-family: 'Barlow', sans-serif; font-size: 12px; font-weight: 600;
    letter-spacing: 2.5px; text-transform: uppercase; color: var(--fl-orange);
}
.login-card .body { padding: 30px 32px 34px; }
.login-card .btn { width: 100%; margin-top: 6px; }
.login-foot { text-align: center; font-size: 12px; color: var(--fl-muted); margin-top: 18px; }

/* =============================================================================
   Modal
   ============================================================================= */
.modal-bg {
    position: fixed; inset: 0; background: rgba(18, 66, 114, .55);
    display: none; align-items: center; justify-content: center; z-index: 1000; padding: 24px;
}
.modal-bg.open { display: flex; }
.modal {
    background: #fff; border-radius: var(--fl-r-card);
    width: 100%; max-width: 480px;
    box-shadow: 0 20px 50px -12px rgba(18, 66, 114, .55);
    max-height: 90vh; overflow-y: auto;
}
.modal .head { padding: 18px 22px; border-bottom: 1px solid var(--fl-border); }
.modal .body { padding: 22px; }
.modal .foot { padding: 16px 22px; border-top: 1px solid var(--fl-border); display: flex; justify-content: flex-end; gap: 10px; }

/* =============================================================================
   Diversen
   ============================================================================= */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 18px; } .mt-3 { margin-top: 28px; }
.mb-2 { margin-bottom: 18px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }

.kv { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 10px 20px; font-size: 14px; }
.kv dt { color: var(--fl-muted); }
.kv dd { color: var(--fl-heading); font-weight: 500; word-break: break-all; }

.copy-field {
    display: flex; align-items: center; gap: 8px;
    background: #F5F7FA; border: 1px solid var(--fl-border);
    border-radius: var(--fl-r-input); padding: 9px 12px;
    font-family: ui-monospace, Consolas, monospace; font-size: 13px;
    word-break: break-all;
}
.copy-field button {
    margin-left: auto; background: none; border: none; cursor: pointer;
    color: var(--fl-link); font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* =============================================================================
   Responsive
   ============================================================================= */
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 992px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: -100%; z-index: 900; transition: left .25s; }
    .sidebar.open { left: 0; }
    .nav-toggle { display: inline-flex !important; }
}
@media (max-width: 640px) {
    .grid-4 { grid-template-columns: 1fr; }
    .content, .page-head { padding-left: 16px; padding-right: 16px; }
    .topbar { padding-left: 16px; padding-right: 16px; }
}

.nav-toggle {
    display: none; background: none; border: none; cursor: pointer;
    padding: 8px; margin-right: 8px;
}
.nav-toggle span { display: block; width: 24px; height: 3px; background: var(--fl-blue); margin: 4px 0; border-radius: 2px; }
