/* ============================================================
   assets/css/app.css — C2Y Tools hoofdstijl
   Kleurenschema gebaseerd op c2y.be: blauw + wit + grijs
   ============================================================ */

:root {
    --c2y-blue:       #0055A4;
    --c2y-blue-dark:  #003d7a;
    --c2y-blue-light: #e8f0fb;
    --c2y-accent:     #00A0E3;
    --sidebar-width:  240px;
    --topbar-height:  56px;
    --body-bg:        #f4f6f9;
    --card-border:    #e2e8f0;
    --text-muted:     #64748b;
    --success:        #16a34a;
    --danger:         #dc2626;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
    color: #1e293b;
    font-size: 14px;
    margin: 0;
}

/* ---- SIDEBAR ---- */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--c2y-blue);
    color: #fff;
    position: fixed;
    top: 0; left: 0;
    z-index: 1000;
    transition: transform .25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    margin-bottom: 8px;
}
.sidebar-logo a { text-decoration: none; display: flex; align-items: baseline; gap: 4px; }
.logo-c2y   { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.logo-tools { font-size: 13px; color: rgba(255,255,255,.65); font-weight: 400; }

.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,.45);
    padding: 16px 20px 4px;
}

.sidebar-nav { list-style: none; margin: 0; padding: 0; }
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: rgba(255,255,255,.8);
    text-decoration: none;
    font-size: 13.5px;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}
.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: rgba(255,255,255,.12);
    color: #fff;
    border-left-color: var(--c2y-accent);
}
.sidebar-nav li a i { font-size: 15px; width: 18px; text-align: center; }

.sidebar-footer {
    margin-top: auto;
    padding: 16px 16px 20px;
    border-top: 1px solid rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--c2y-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name  { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 11px; color: rgba(255,255,255,.55); }
.sidebar-logout {
    color: rgba(255,255,255,.6);
    font-size: 17px;
    text-decoration: none;
    padding: 4px;
    flex-shrink: 0;
}
.sidebar-logout:hover { color: #fff; }


/* ---- SIDEBAR ACCORDION GROEPEN ---- */
.sidebar-group { list-style: none; }

.sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 9px 20px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    color: rgba(255,255,255,.8);
    font-size: 13.5px;
    cursor: pointer;
    text-align: left;
    transition: background .15s, color .15s, border-color .15s;
}
.sidebar-group-toggle:hover,
.sidebar-group.open .sidebar-group-toggle {
    background: rgba(255,255,255,.12);
    color: #fff;
    border-left-color: var(--c2y-accent);
}
.sidebar-group-toggle .toggle-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-group-toggle .toggle-left i {
    font-size: 15px;
    width: 18px;
    text-align: center;
}
.toggle-arrow {
    font-size: 11px !important;
    width: auto !important;
    transition: transform .2s ease;
    opacity: .7;
    flex-shrink: 0;
}
.sidebar-group.open .toggle-arrow {
    transform: rotate(90deg);
    opacity: 1;
}

/* Subnav */
.sidebar-subnav {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
    background: rgba(0,0,0,.15);
}
.sidebar-group.open .sidebar-subnav {
    max-height: 400px;
}
.sidebar-subnav li a {
    padding: 7px 20px 7px 44px;
    font-size: 13px;
    border-left: 3px solid transparent;
    color: rgba(255,255,255,.7);
}
.sidebar-subnav li a:hover,
.sidebar-subnav li a.active {
    background: rgba(255,255,255,.08);
    color: #fff;
    border-left-color: var(--c2y-accent);
}

/* ---- CONTENT ---- */
#content-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-title { font-size: 16px; font-weight: 600; margin: 0; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle {
    background: none; border: none;
    font-size: 20px; color: var(--text-muted);
    cursor: pointer; padding: 4px;
    display: none;
}

.main-content { padding: 24px; flex: 1; }

/* ---- CARDS ---- */
.c2y-card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 20px;
}
.c2y-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}
.c2y-card-title { font-size: 15px; font-weight: 600; margin: 0; }

/* ---- STATS CARDS ---- */
.stat-card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-icon.blue   { background: var(--c2y-blue-light); color: var(--c2y-blue); }
.stat-icon.green  { background: #dcfce7; color: #16a34a; }
.stat-icon.orange { background: #fff7ed; color: #ea580c; }
.stat-icon.purple { background: #f3e8ff; color: #7c3aed; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- BUTTONS ---- */
.btn-c2y {
    background: var(--c2y-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .15s;
}
.btn-c2y:hover { background: var(--c2y-blue-dark); color: #fff; }
.btn-c2y-outline {
    background: transparent;
    color: var(--c2y-blue);
    border: 1px solid var(--c2y-blue);
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .15s;
}
.btn-c2y-outline:hover { background: var(--c2y-blue); color: #fff; }

/* ---- TABLES ---- */
.c2y-table { width: 100%; border-collapse: collapse; }
.c2y-table th {
    background: #f8fafc;
    border-bottom: 1px solid var(--card-border);
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
}
.c2y-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.c2y-table tr:last-child td { border-bottom: none; }
.c2y-table tr:hover td { background: #f8fafc; }

/* ---- FORMS ---- */
.form-label { font-size: 13px; font-weight: 500; margin-bottom: 5px; color: #374151; }
.form-control, .form-select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13.5px;
    padding: 8px 12px;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--c2y-blue);
    box-shadow: 0 0 0 3px rgba(0,85,164,.1);
    outline: none;
}

/* ---- DRAG & DROP ZONE ---- */
.dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--c2y-blue);
    background: var(--c2y-blue-light);
}
.dropzone i { font-size: 40px; color: #94a3b8; margin-bottom: 10px; }
.dropzone.dragover i { color: var(--c2y-blue); }
.dropzone-text { color: var(--text-muted); font-size: 13.5px; }
.dropzone-text strong { color: var(--c2y-blue); }

/* ---- QUOTE BUILDER ---- */
.quote-line-row td { padding: 6px 8px; }
.quote-line-row input, .quote-line-row select {
    font-size: 13px;
    padding: 5px 8px;
    height: 32px;
}
.line-total-cell { font-weight: 600; text-align: right; }
.quote-totals-box {
    background: #f8fafc;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 16px 20px;
    min-width: 260px;
}
.quote-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13.5px;
}
.quote-totals-row.total {
    font-size: 16px;
    font-weight: 700;
    border-top: 1px solid var(--card-border);
    margin-top: 6px;
    padding-top: 10px;
    color: var(--c2y-blue);
}

/* ---- AI BADGE ---- */
.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
}

/* ---- HISTORY TIMELINE ---- */
.history-timeline { position: relative; padding-left: 28px; }
.history-timeline::before {
    content: '';
    position: absolute;
    left: 9px; top: 0; bottom: 0;
    width: 2px;
    background: var(--card-border);
}
.history-item { position: relative; margin-bottom: 16px; }
.history-dot {
    position: absolute;
    left: -24px;
    top: 3px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--c2y-blue);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--c2y-blue);
}
.history-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---- STATUS BADGES ---- */
.badge { font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 20px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    #sidebar { transform: translateX(-100%); }
    #sidebar.open { transform: translateX(0); }
    #content-wrapper { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .main-content { padding: 16px; }
}

/* ---- LOGIN PAGE ---- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c2y-blue);
}
.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-c2y   { font-size: 36px; font-weight: 900; color: var(--c2y-blue); }
.login-logo .logo-tools { font-size: 16px; color: var(--text-muted); display: block; }

/* ---- INPUT TABS (msg / paste) ---- */
.input-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
}
.input-tab {
    flex: 1;
    padding: 8px 12px;
    background: #f8fafc;
    border: none;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
    border-right: 1px solid var(--card-border);
}
.input-tab:last-child { border-right: none; }
.input-tab:hover { background: #f1f5f9; color: #1e293b; }
.input-tab.active {
    background: var(--c2y-blue);
    color: #fff;
    font-weight: 500;
}

/* ---- KLANT ZOEK DROPDOWN ---- */
.customer-dropdown {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
    z-index: 500;
    max-height: 260px;
    overflow-y: auto;
}
.customer-dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background .1s;
}
.customer-dropdown-item:last-child { border-bottom: none; }
.customer-dropdown-item:hover { background: var(--c2y-blue-light); }

/* ---- SPECIFICATIES TABEL ---- */
.specs-table-wrap { border: 1px solid var(--card-border) !important; }
.specs-table-wrap .form-control-sm {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 4px 6px;
    font-size: 13px;
}
.specs-table-wrap .form-control-sm:focus {
    background: var(--c2y-blue-light);
    box-shadow: none;
    border: none;
}
#specs-table tbody tr:hover td { background: #f8fafc; }