/* =====================================================
   RESET
===================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =====================================================
   BASIS
===================================================== */
body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: #f1f3f6;
    color: #1f2937;
}

a {
    color: #2563eb;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* =====================================================
   LAYOUT
===================================================== */
.container {
    max-width: 1100px;
    margin: 0 auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

/* =====================================================
   CARDS
===================================================== */
.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

/* =====================================================
   TEKST / HELPERS
===================================================== */
.small {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.amount {
    font-size: 1.4rem;
    font-weight: 600;
}

.list-item {
    margin-bottom: 12px;
}

/* =====================================================
   FORMULIEREN
===================================================== */
.form-group {
    margin-bottom: 16px;
}

input,
select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 1rem;
    background: #fff;
}
select:focus,
input:focus {
    outline: none;
    border-color: #2563eb;
}

input:focus {
    outline: none;
    border-color: #2563eb;
}
select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #6b7280 50%),
        linear-gradient(135deg, #6b7280 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(1em + 2px),
        calc(100% - 15px) calc(1em + 2px);
    background-size:
        5px 5px,
        5px 5px;
    background-repeat: no-repeat;
}

/* =====================================================
   BUTTONS
===================================================== */
button {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: #2563eb;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

button:hover {
    background: #1d4ed8;
}

/* =====================================================
   FEEDBACK
===================================================== */
.error {
    color: #dc2626;
    margin-bottom: 12px;
}

/* =====================================================
   LOGIN / CENTERED LAYOUT
===================================================== */
.centered {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
}

/* =====================================================
   PROGRESS / BUDGET
===================================================== */
.progress {
    background: #e5e7eb;
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 12px;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 8px;
}

.budget-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 500;
}

.budget-remaining {
    color: #16a34a;
}

.budget-negative {
    color: #dc2626;
}

/* =====================================================
   APP LAYOUT
===================================================== */
.app {
    display: flex;
    min-height: 100vh;
}

/* =====================================================
   SIDEBAR
===================================================== */
.sidebar {
    width: 240px;
    background: #111827;
    color: #fff;
    padding: 20px;
    transition: width 0.25s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 72px;
}

/* Toggle */
.toggle-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.4rem;
    cursor: pointer;
    margin-bottom: 20px;
}

/* Menu */
.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d1d5db;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar a:hover {
    background: #1f2937;
    color: #fff;
}

/* Icons & labels */
.menu-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.label {
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* =====================================================
   CONTENT
===================================================== */
.content {
    flex: 1;
    padding: 30px;
}

/* =====================================================
   RESPONSIVE
===================================================== */
@media (max-width: 600px) {
    .content {
        padding: 20px;
    }
}
/* =====================================================
   VASTE LASTEN – CATEGORIE OVERZICHT
===================================================== */

/* Container per categorie */
.category-block {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
}

/* Titel van categorie */
.category-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #111827;
}

/* Lijst item (vaste last regel) */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #e5e7eb;
}

.category-item:first-child {
    border-top: none;
}

/* Linkerkant (naam + omschrijving) */
.category-item-info {
    max-width: 60%;
}

.category-item-info .name {
    font-weight: 500;
}

.category-item-info .desc {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Rechterkant (bedrag + checkbox) */
.category-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Input iets compacter in lijsten */
.category-item-actions input[type="number"] {
    width: 100px;
}
/* =====================================================
   FIXED COSTS – TOP MENU
===================================================== */

.fixed-top-menu {
    position: sticky;
    top: 0;
    z-index: 5;
    margin-bottom: 20px;
}

.fixed-top-menu-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-link {
    padding: 6px 12px;
    border-radius: 8px;
    background: #e5e7eb;
    color: #111827;
    font-size: 0.9rem;
}

.menu-link:hover {
    background: #d1d5db;
}

.menu-link.active {
    background: #2563eb;
    color: #fff;
}
/* =====================================================
   STICKY OPSLAAN KNOP
===================================================== */

.sticky-save {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10;
}

.sticky-save button {
    width: auto;
    padding: 14px 20px;
    font-size: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
/* =====================================================
   CATEGORIE BEHEER – LIJST
===================================================== */

.category-admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-admin-row {
    display: grid;
    grid-template-columns: 1.5fr 2fr 80px auto;
    gap: 10px;
    align-items: center;
}

.cat-name {
    font-weight: 500;
}

.cat-desc {
    color: #374151;
}

.cat-order {
    width: 80px;
}

.cat-actions {
    display: flex;
    gap: 8px;
}

button.danger {
    background: #dc2626;
}

button.danger:hover {
    background: #b91c1c;
}
/* =====================================================
   CATEGORIE BEHEER – BELANGRIJKHEID
===================================================== */

.cat-order-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cat-order-wrap label {
    font-size: 0.75rem;
    color: #6b7280;
}
/* =====================================================
   CATEGORIE BEHEER – LIJST & HEADER
===================================================== */

.category-admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Header boven de lijst */
.category-admin-header {
    display: grid;
    grid-template-columns: 1.5fr 2fr 90px auto;
    gap: 10px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}

/* Rij */
.category-admin-row {
    display: grid;
    grid-template-columns: 1.5fr 2fr 90px auto;
    gap: 10px;
    align-items: center;
}

/* Inputs */
.cat-name {
    font-weight: 500;
}

.cat-desc {
    color: #374151;
}

.cat-order {
    width: 90px;
}

/* Acties */
.cat-actions {
    display: flex;
    gap: 8px;
}

button.danger {
    background: #dc2626;
}

button.danger:hover {
    background: #b91c1c;
}
/* =====================================================
   SIDEBAR – SUBMENU
===================================================== */

.has-submenu > a {
    cursor: pointer;
}

.submenu {
    display: none;
    list-style: none;
    margin-left: 12px;
    margin-top: 6px;
}

.has-submenu.open .submenu {
    display: block;
}

.submenu a {
    font-size: 0.9rem;
    padding: 8px 10px;
}
/* ===== LUXE SIDEBAR ===== */
.sidebar {
    background: linear-gradient(180deg, #0f172a, #020617);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.sidebar .brand {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #f8fafc;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    color: #cbd5f5;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #ffffff;
}

.nav-item .nav-indicator {
    width: 4px;
    height: 100%;
    background: transparent;
    border-radius: 2px;
    margin-right: 10px;
    transition: background 0.2s ease;
}

.nav-item:hover .nav-indicator {
    background: #2563eb;
}

.nav-item.highlight {
    background: rgba(37,99,235,0.15);
    color: #ffffff;
}

.nav-item.highlight .nav-indicator {
    background: #2563eb;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
}

.nav-item.logout {
    color: #9ca3af;
}

.nav-item.logout:hover {
    background: rgba(220,38,38,0.12);
    color: #fecaca;
}

/* COLLAPSED */
.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar.collapsed {
    width: 70px;
}
/* ===== SIDEBAR TOGGLE – VASTE POSITIE ===== */

.sidebar-header {
    position: relative;
    height: 44px; /* vaste hoogte voorkomt springen */
}

.toggle-fixed {
    position: absolute;
    left: 12px;   /* 🔑 altijd links */
    top: 8px;
    z-index: 20;

    width: 32px;
    height: 32px;
    border-radius: 8px;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* Brand iets opschuiven zodat hij de toggle niet raakt */
.sidebar .brand {
    margin-left: 44px;
}

/* Bij collapsed: brand weg, toggle blijft exact staan */
.sidebar.collapsed .brand {
    display: none;
}

/* Sidebar breedte blijft leidend, toggle beweegt niet */
.sidebar.collapsed .toggle-fixed {
    left: 12px;
}
/* ===== FIXED COSTS TABLE LAYOUT ===== */
/* ===== BUDGET CREATE TABLES ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.table th,
.table td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table th {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
}

.hidden {
    display: none;
}

.actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.flex-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.add-row-btn {
    margin-top: 10px;
    background: transparent;
    color: #2563eb;
    font-weight: 600;
    padding: 8px 0;
    border: none;
    cursor: pointer;
}

.add-row-btn:hover {
    text-decoration: underline;
}
/* ===== BUDGET ALERT ===== */
.budget-alert-warning {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.budget-alert-danger {
    border-left: 4px solid #dc2626;
    background: #fef2f2;
    color: #7f1d1d;
}
.danger-zone a {
    color: #f87171;
}
.danger-zone a:hover {
    background: #7f1d1d;
    color: #fff;
}
