/* App styles — source of truth (copied to dist/ by build.mjs). */

/* ---- Theme tokens ---- */
:root {
    --brand: #2c4a7c;          /* deep navy — primary brand */
    --brand-dark: #213a63;
    --brand-accent: #3498db;   /* blue accent (matches spinner) */
    --surface: #f5f7ff;        /* light lavender surface */
    --text: #1f2733;
    --muted: #6b7280;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

/* ---- Alpine ---- */
[x-cloak] { display: none !important; }

/* ---- Base ---- */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text);
    background-color: #fbfcfe;
}

h1 { font-weight: 600; }
h2, h3 { font-weight: 600; color: var(--brand-dark); }
h2 { font-size: 1.4rem; margin-bottom: 1rem; }
h3 { font-size: 1.15rem; margin-top: 1.5rem; }

a { color: var(--brand-accent); }

main {
    margin-top: 30px;
    margin-bottom: 50px;
}

/* ---- Header ---- */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}
.logo { margin-top: 20px; width: 150px; height: auto; border: none; outline: none; }

/* ---- Navbar ---- */
#navbar {
    background-color: var(--brand) !important;
    box-shadow: var(--shadow);
}

/* ---- Footer ---- */
footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--muted);
    font-size: 0.85rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* ---- Content cards (list / client / log views) ---- */
#grid, #client, #log {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.hidden { display: none; }

/* ---- Tables / grid ---- */
.gridjs-wrapper { min-height: 400px; }
table { font-size: 0.9rem; }

.lisa-table tr:hover {
    cursor: pointer;
    background-color: rgba(52, 152, 219, 0.12);
    transition: background-color 0.2s ease;
}

/* ---- Forms ---- */
.form-label {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text);
}
.form-control, .form-select {
    margin-bottom: 0.75rem;
}
.form-control::placeholder {
    color: #adb5bd;
    opacity: 1;
}
input[readonly] {
    background-color: #f0f2f5;
    cursor: not-allowed;
}

/* Primary action buttons (form submit) */
.form-submit {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #fff;
    padding: 0.5rem 1.25rem;
    margin-top: 0.5rem;
}
.form-submit:hover,
.form-submit:focus {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

/* ---- Loader ---- */
.fullscreen-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s ease-in-out;
}
.fullscreen-loader.active { visibility: visible; opacity: 1; }

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid var(--brand-accent);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---- Form overlay (Bootstrap forms shown over a backdrop) ---- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.popup {
    position: relative;
    width: 75%;
    max-width: 900px;
    margin: 80px auto;
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.18);
    overflow-y: auto;
    max-height: 90vh;
}

.close-btn {
    color: var(--muted);
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 23px;
}
.close-btn:hover,
.close-btn:focus {
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

/* ---- Alpine info/error/table dialog ---- */
.dialog-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1050; }
.dialog-box { background: #fff; border-radius: var(--radius); padding: 28px; max-width: 80%; max-height: 80vh; overflow: auto; position: relative; box-shadow: 0 8px 24px rgba(16, 24, 40, 0.2); }
.dialog-box.dialog-error { border-top: 4px solid #dc3545; }
.dialog-close { position: absolute; top: 8px; right: 12px; cursor: pointer; font-size: 1.5rem; line-height: 1; color: var(--muted); }
.dialog-close:hover { color: var(--text); }
