/*
 * Volkstuintje — Shared Stylesheet (Laravel)
 * Version: 1.1
 * Date:    2026-05-23
 *
 * Basis: de administratie-app stylesheet (app.css v1.0), aangevuld met de
 * topmenu-stijlen die voorheen inline in topmenu_class.php::render() zaten.
 * Eén stylesheet voor de hele Volkstuintje Laravel-look.
 *
 * Inladen via de layout:
 *   <link rel="stylesheet" href="{{ asset('css/volkstuintje.css') }}">
 */

/* ================================================================
   DESIGN TOKENS
   ================================================================ */
:root {
    --color-bg           : #f5f7fb;
    --color-surface      : #ffffff;
    --color-border       : #e5e7eb;
    --color-border-light : #f3f4f6;
    --color-text         : #111827;
    --color-muted        : #6b7280;
    --color-primary      : #111827;
    --color-primary-hover: #1f2937;
    --color-accent       : #16a34a;
    --color-accent-hover : #15803d;
    --color-accent-soft  : #dcfce7;
    --color-accent-text  : #166534;
    --color-danger       : #dc2626;
    --color-success-bg   : #f0fdf4;
    --color-success-border: #bbf7d0;
    --color-success-text : #166534;
    --color-error-bg     : #fef2f2;
    --color-error-border : #fecaca;
    --color-error-text   : #991b1b;
    --color-warn-bg      : #fef3c7;
    --color-warn-border  : #fde68a;
    --color-warn-text    : #92400e;
    --color-info-bg      : #eff6ff;
    --color-info-border  : #bfdbfe;
    --color-info-text    : #1e40af;
    --radius             : 4px;
    --radius-lg          : 8px;
    --font               : Arial, sans-serif;
    --font-mono          : 'Courier New', Courier, monospace;
}

/* ================================================================
   RESET / BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

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

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

h2 { margin: 0 0 4px; font-size: 1.4em; }
h3 { margin: 0 0 14px; font-size: 1em; color: #374151; }

code {
    font-family     : var(--font-mono);
    font-size       : 0.88em;
    background      : var(--color-border-light);
    padding         : 1px 5px;
    border-radius   : var(--radius);
}

/* ================================================================
   TOPMENU  (voorheen inline in topmenu_class.php::render())
   ================================================================ */
nav.main-menu { background: var(--color-accent); padding: 0; }
ul.menu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
ul.menu-list > li { position: relative; }
li.menu-item a, li.dropdown > .dropdown-label {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 12px 16px;
    display: block;
    cursor: pointer;
}
li.menu-item a:hover, li.dropdown > .dropdown-label:hover { background: var(--color-accent-hover); text-decoration: none; }

li.menu-item.disabled > a,
li.dropdown-item.disabled > a {
    color: rgba(255,255,255,0.5);
    cursor: not-allowed;
}

ul.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 0;
}
ul.dropdown-menu.open { display: block; }

ul.dropdown-menu > li.dropdown-item > a {
    color: #333;
    padding: 10px 14px;
    text-decoration: none;
    display: block;
}
ul.dropdown-menu > li.dropdown-item > a:hover { background: #f4f4f4; text-decoration: none; }

ul.dropdown-menu > li.dropdown-item.disabled > a {
    color: #bbb;
    cursor: not-allowed;
}
ul.dropdown-menu > li.dropdown-item.disabled > a:hover { background: transparent; }

ul.dropdown-menu > li.dropdown-subgroup > .subgroup-label {
    color: #333;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
ul.dropdown-menu > li.dropdown-subgroup > .subgroup-label:hover { background: #f4f4f4; }
ul.dropdown-menu > li.dropdown-subgroup > .subgroup-label .arrow {
    font-size: 0.8em;
    transition: transform 0.15s;
    color: #888;
}
ul.dropdown-menu > li.dropdown-subgroup.open > .subgroup-label .arrow {
    transform: rotate(90deg);
}

ul.subgroup-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f9f9f9;
    border-left: 3px solid var(--color-accent);
}
ul.subgroup-menu.open { display: block; }
ul.subgroup-menu li a {
    color: #333;
    padding: 8px 14px 8px 22px;
    text-decoration: none;
    display: block;
    font-size: 0.95em;
}
ul.subgroup-menu li a:hover { background: #eef4ff; text-decoration: none; }
ul.subgroup-menu li.disabled a { color: #bbb; cursor: not-allowed; }
ul.subgroup-menu li.disabled a:hover { background: transparent; }

/* Secondary menu (per-page action bar) */
nav.secondary-menu { background: #f4f4f4; padding: 8px 12px; }
ul.secondary-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
ul.secondary-list > li.secondary-item a {
    color: #333;
    text-decoration: none;
    padding: 6px 10px;
    display: block;
}
ul.secondary-list > li.secondary-item a:hover { color: var(--color-accent); }

/* ================================================================
   LAYOUT
   ================================================================ */
.content {
    padding    : 20px;
    max-width  : 960px;
}

.content-wide  { max-width: 1200px; }
.content-narrow{ max-width: 620px; }

.subhead {
    color       : var(--color-muted);
    font-size   : 0.88em;
    margin-bottom: 16px;
}

.grid-2 {
    display              : grid;
    grid-template-columns: 1fr 1fr;
    gap                  : 12px;
}

.grid-3 {
    display              : grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap                  : 12px;
}

.info-grid {
    display              : grid;
    grid-template-columns: 160px 1fr;
    gap                  : 4px 12px;
    font-size            : 0.9em;
}

.info-grid .lbl {
    font-weight : bold;
    color       : var(--color-muted);
    font-size   : 0.85em;
    padding     : 4px 0;
}

.info-grid .val { padding: 4px 0; }

/* ================================================================
   CARD
   ================================================================ */
.card {
    background    : var(--color-surface);
    border        : 1px solid var(--color-border);
    border-radius : var(--radius-lg);
    padding       : 18px 20px;
    margin-bottom : 16px;
}

.card h3 {
    border-bottom  : 1px solid var(--color-border-light);
    padding-bottom : 8px;
    margin-bottom  : 14px;
}

/* ================================================================
   TABS
   ================================================================ */
nav.tabs {
    display       : flex;
    gap           : 4px;
    margin-bottom : 16px;
    flex-wrap     : wrap;
}

nav.tabs a,
.tab {
    padding       : 6px 14px;
    border-radius : 20px;
    font-size     : 0.85em;
    text-decoration: none;
    border        : 1px solid var(--color-border);
    background    : var(--color-surface);
    color         : var(--color-muted);
    display       : inline-block;
    cursor        : pointer;
}

nav.tabs a.active,
.tab.active {
    background    : var(--color-primary);
    color         : #fff;
    border-color  : var(--color-primary);
}

nav.tabs a:hover:not(.active),
.tab:hover:not(.active) {
    background    : var(--color-border-light);
    text-decoration: none;
}

/* ================================================================
   TABLE
   ================================================================ */
table {
    width           : 100%;
    border-collapse : collapse;
    background      : var(--color-surface);
    border          : 1px solid var(--color-border);
    border-radius   : var(--radius-lg);
    overflow        : hidden;
    font-size       : 0.88em;
    margin-bottom   : 8px;
}

th {
    background    : #f9fafb;
    font-size     : 0.82em;
    padding       : 8px 12px;
    text-align    : left;
    border-bottom : 1px solid var(--color-border);
    font-weight   : bold;
    color         : #374151;
}

th a { color: #374151; text-decoration: none; }
th a:hover { text-decoration: underline; }

td {
    padding        : 8px 12px;
    border-bottom  : 1px solid var(--color-border-light);
    vertical-align : middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td      { background: #fafafa; }

tr.data-row:hover { background: #f4f4f4; cursor: pointer; }

.meta {
    font-size : 0.82em;
    color     : var(--color-muted);
}

/* ================================================================
   FORM ELEMENTS
   ================================================================ */
.form-row { margin-bottom: 12px; }

.form-row label,
label {
    display     : block;
    font-size   : 0.85em;
    font-weight : bold;
    margin-bottom: 3px;
    color       : #374151;
}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=date],
input[type=file],
input[type=search],
select,
textarea {
    width         : 100%;
    padding       : 7px 9px;
    border        : 1px solid #ccc;
    border-radius : var(--radius);
    font-size     : 0.9em;
    font-family   : var(--font);
    box-sizing    : border-box;
    background    : var(--color-surface);
    color         : var(--color-text);
}

input[type=file] { padding: 5px; }
textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
    outline     : none;
    border-color: var(--color-primary);
    box-shadow  : 0 0 0 2px rgba(17,24,39,.08);
}

input[readonly], input[disabled] {
    background : var(--color-border-light);
    color      : var(--color-muted);
    cursor     : not-allowed;
}

.hint {
    font-size : 0.78em;
    color     : var(--color-muted);
    margin-top: 3px;
}

.checkbox-row {
    display    : flex;
    align-items: center;
    gap        : 8px;
    font-size  : 0.88em;
    cursor     : pointer;
}

.checkbox-row input[type=checkbox] { width: auto; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    display       : inline-block;
    padding       : 7px 16px;
    border-radius : var(--radius);
    font-size     : 0.9em;
    font-family   : var(--font);
    cursor        : pointer;
    border        : none;
    text-decoration: none;
    background    : var(--color-primary);
    color         : #fff;
    transition    : background .15s;
}

.btn-primary { background: var(--color-accent); }
.btn-primary:hover { background: var(--color-accent-hover); color: #fff; }

.btn:hover { background: var(--color-primary-hover); color: #fff; text-decoration: none; }

.btn-sm   { padding: 4px 10px; font-size: 0.82em; }

.btn-secondary,
.btn-cancel {
    background  : #f0f0f0;
    color       : #333;
    border      : 1px solid #ccc;
}
.btn-secondary:hover,
.btn-cancel:hover { background: #e5e5e5; color: #333; }

.btn-danger {
    background  : var(--color-surface);
    color       : var(--color-danger);
    border      : 1px solid var(--color-error-border);
}
.btn-danger:hover { background: var(--color-error-bg); color: var(--color-danger); }

.btn-outline {
    background  : var(--color-surface);
    color       : #374151;
    border      : 1px solid var(--color-border);
}
.btn-outline:hover { background: var(--color-border-light); }

.btn-green { background: var(--color-accent); }
.btn-green:hover { background: var(--color-accent-hover); }

.actions {
    display : flex;
    gap     : 10px;
    align-items: center;
    margin-top: 8px;
}

/* ================================================================
   BADGES
   ================================================================ */
.badge {
    display       : inline-block;
    padding       : 2px 8px;
    border-radius : 10px;
    font-size     : 0.78em;
    font-weight   : bold;
    white-space   : nowrap;
}

.badge-success, .badge-active, .badge-ok { background: #dcfce7; color: #166534; }
.badge-warning, .badge-warn { background: var(--color-warn-bg); color: var(--color-warn-text); }
.badge-danger, .badge-urgent, .badge-error { background: var(--color-error-bg); color: var(--color-error-text); }
.badge-info { background: var(--color-info-bg); color: var(--color-info-text); }
.badge-neutral, .badge-expired, .badge-manual { background: #f3f4f6; color: var(--color-muted); }
.badge-auto, .badge-autorenew { background: #dcfce7; color: #166534; }

.badge-VIEW     { background: #f3f4f6; color: var(--color-muted); }
.badge-ADD      { background: #dcfce7; color: #166534; }
.badge-EDIT     { background: var(--color-info-bg); color: var(--color-info-text); }
.badge-DELETE   { background: var(--color-error-bg); color: var(--color-error-text); }
.badge-LOGIN    { background: #ede9fe; color: #5b21b6; }
.badge-RESET    { background: var(--color-warn-bg); color: var(--color-warn-text); }

.badge-Boolean  { background: var(--color-info-bg); color: var(--color-info-text); }
.badge-Integer  { background: #dcfce7; color: #166534; }
.badge-Varchar  { background: var(--color-warn-bg); color: var(--color-warn-text); }

/* ================================================================
   ALERTS / FLASH MESSAGES
   ================================================================ */
.alert {
    padding       : 10px 14px;
    border-radius : var(--radius-lg);
    margin-bottom : 14px;
    font-size     : 0.9em;
    border        : 1px solid transparent;
}

.alert-success, .alert.success {
    background  : var(--color-success-bg);
    border-color: var(--color-success-border);
    color       : var(--color-success-text);
}

.alert-error, .alert-danger, .alert.danger {
    background  : var(--color-error-bg);
    border-color: var(--color-error-border);
    color       : var(--color-error-text);
}

.alert-warning {
    background  : var(--color-warn-bg);
    border-color: var(--color-warn-border);
    color       : var(--color-warn-text);
}

.alert-info {
    background  : var(--color-info-bg);
    border-color: var(--color-info-border);
    color       : var(--color-info-text);
}

.alert ul { margin: 0; padding-left: 18px; }

.alert-2fa {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe;
    padding: 10px 14px; border-radius: 6px; margin-bottom: 12px;
}

.alert-2fa-actions { display: flex; align-items: center; gap: 10px; }

.btn-2fa-dismiss { color: #1e3a8a; text-decoration: underline; font-size: 0.85em; }

/* ================================================================
   FILTER BAR / SEARCH
   ================================================================ */
.filters { margin-bottom: 15px; }

.filter-bar {
    display    : flex;
    gap        : 8px;
    margin-bottom: 14px;
    flex-wrap  : wrap;
    align-items: flex-end;
}

.filter-bar input[type=text],
.filter-bar input[type=search] { width: 240px; }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty {
    padding    : 32px;
    text-align : center;
    color      : var(--color-muted);
    font-size  : 0.9em;
    font-style : italic;
}

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination {
    margin-top : 10px;
    font-size  : 0.88em;
    color      : var(--color-muted);
}

.pagination a {
    margin-right    : 8px;
    text-decoration : none;
    color           : var(--color-primary);
}

/* ================================================================
   PRINT
   ================================================================ */
@media print {
    nav.tabs, nav.main-menu, nav.secondary-menu, .filter-bar, .filters,
    .btn, .actions { display: none !important; }

    body        { background: white; }
    .content    { padding: 0; max-width: 100%; }
    table       { border: none; }
    th, td      { border: 1px solid #ccc; }
    a           { color: inherit; text-decoration: none; }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 640px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .filter-bar       { flex-direction: column; }
    .filter-bar input[type=text] { width: 100%; }
    .info-grid        { grid-template-columns: 120px 1fr; }
    .actions          { flex-wrap: wrap; }
}
