:root {
    --color-bg: #f5f6f8;
    --color-surface: #ffffff;
    --color-border: #dde1e6;
    --color-text: #1f2430;
    --color-muted: #6b7280;
    --color-primary: #2b5fb0;
    --color-primary-hover: #234c8c;
    --color-danger: #c0392b;
    --color-success: #1e8e5a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
}

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

.app-shell { display: flex; min-height: 100vh; align-items: flex-start; }

.sidebar {
    width: 230px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
}

.sidebar .brand { font-weight: 700; font-size: 1.1rem; color: var(--color-text); padding: 1rem 1.25rem; border-bottom: 1px solid var(--color-border); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.75rem 0; }
.sidebar-nav .nav-group { margin-bottom: 0.65rem; }
.sidebar-nav .nav-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
    padding: 0.4rem 1.25rem 0.25rem;
}
.sidebar-nav a {
    display: block;
    padding: 0.4rem 1.25rem;
    font-size: 0.9rem;
    color: var(--color-text);
    border-right: 3px solid transparent;
}
.sidebar-nav a:hover { background: var(--color-bg); text-decoration: none; }
.sidebar-nav a.active {
    background: #eaf0fb;
    color: var(--color-primary);
    font-weight: 600;
    border-right-color: var(--color-primary);
}

.sidebar .user {
    border-top: 1px solid var(--color-border);
    padding: 0.85rem 1.25rem;
    font-size: 0.85rem;
    color: var(--color-muted);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sidebar .user select { width: 100%; padding: 0.3rem; border: 1px solid var(--color-border); border-radius: 6px; font-size: 0.85rem; }

.main-content { flex: 1; min-width: 0; }

.container { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; }

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
}

.flex-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn:hover { background: var(--color-primary-hover); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--color-primary); }
.btn-secondary:hover { background: var(--color-primary); color: #fff; }
.btn-danger { background: transparent; border-color: var(--color-danger); color: var(--color-danger); }
.btn-danger:hover { background: var(--color-danger); color: #fff; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--color-border); }
th { color: var(--color-muted); font-weight: 600; cursor: pointer; user-select: none; }
tbody tr:hover { background: #fafbfc; }

.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; }
.badge-ok { background: #e3f4ea; color: var(--color-success); }
.badge-hold { background: #fdf1de; color: #b5751a; }
.badge-credit { background: #fbe4e2; color: var(--color-danger); }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
.field input[type=text], .field input[type=password], .field input[type=email], .field input[type=date], .field input[type=number], .field select {
    width: 100%; padding: 0.5rem; border: 1px solid var(--color-border); border-radius: 6px; font-size: 0.9rem;
}
.field .error { color: var(--color-danger); font-size: 0.8rem; margin-top: 0.25rem; }
.field-inline { display: flex; align-items: center; gap: 0.5rem; }

.status { background: #e3f4ea; color: var(--color-success); padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.status-error { background: #fbe4e2; color: var(--color-danger); }
.search-bar input { padding: 0.5rem; border: 1px solid var(--color-border); border-radius: 6px; width: 280px; }

/*
 * Laravel's default pagination view (used by ->links()) is Tailwind-based,
 * but this project links a hand-written public/css/app.css directly rather
 * than building through Vite/Tailwind — so those utility classes (w-5 h-5,
 * hidden sm:flex, etc.) never apply. Without them the prev/next chevron
 * SVGs render at an unconstrained default size; this reins them back in and
 * gives the nav sane spacing to match the rest of the app's compact style.
 */
nav[role="navigation"] { font-size: 0.85rem; color: var(--color-muted); }
nav[role="navigation"] svg { width: 1rem; height: 1rem; vertical-align: middle; }
nav[role="navigation"] a, nav[role="navigation"] span { color: var(--color-text); }
nav[role="navigation"] a:hover { text-decoration: none; color: var(--color-primary); }

.guest-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.guest-card { width: 340px; }
.guest-card h1 { font-size: 1.25rem; margin-bottom: 1.25rem; }

/* This app's first modal/overlay -- see the "Work Folder" popup on Ads/Form. */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}
.modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
}
[x-cloak] { display: none !important; }
