/* Version: 1.0.1 */
/* THOR Owner — shared CSS for owner/manager dashboard pages */
/* Based on style_admin.css — blue theme instead of red */

:root {
    --primary:  #00aaff;
    --dark:     #0088cc;
    --bg:       #0f0f0f;
    --card:     #1e1e1e;
    --input:    #2a2a2a;
    --border:   #333;
    --border2:  #444;
    --text:     #e0e0e0;
    --muted:    #777;
    --code-bg:  #2a2a2a;
    --green:    #28a745;
    --red-soft: #dc3545;
    --blue:     #3498db;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ── Container ──────────────────────────────────────── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Header ─────────────────────────────────────────── */
header {
    background: #1a1a1a;
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    padding-top: 0;
    padding-bottom: 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    position: relative;
}

/* ── Logo ───────────────────────────────────────────── */
.logo {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}
.logo:hover { opacity: 0.85; }

/* ── Nav links ──────────────────────────────────────── */
.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    align-items: center;
}
.nav-links a          { color: #ccc; text-decoration: none; font-weight: 500; transition: color 0.3s; }
.nav-links a:hover,
.nav-links a.active   { color: var(--primary); font-weight: bold; }
.nav-links .user-info { color: #00ff88; font-weight: bold; margin-left: auto; }
.nav-links .logout a  { color: #ff6b6b; font-weight: bold; }

/* ── Lang selector ──────────────────────────────────── */
.lang-selector {
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Cards ──────────────────────────────────────────── */
.card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ── Headings ───────────────────────────────────────── */
h1, h2, h3 { color: var(--primary); margin: 0 0 1rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }

/* ── Main content ───────────────────────────────────── */
main {
    padding: 1rem 0;
}

/* ── Footer ─────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 2rem 0;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* ── Forms & inputs ─────────────────────────────────── */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #aaa;
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--input);
    border: 1px solid var(--border2);
    border-radius: 6px;
    color: #fff;
    font-size: 0.95rem;
    transition: border 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}
.btn:hover { background: var(--dark); }

.btn-save {
    background: var(--green);
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}
.btn-save:hover { background: #1e8c3a; }

.btn-danger {
    background: transparent;
    color: #fff;
    border: 2px solid #cc0000;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}
.btn-danger:hover { background: #cc0000; color: #fff; }

/* ── Search / filter bar ────────────────────────────── */
.search {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
}
.search input[type="text"] {
    flex: 1;
    min-width: 200px;
}
.btn-search  { padding: 10px 18px; background: var(--primary); color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; }
.btn-search:hover { background: var(--dark); }
.btn-reset   { padding: 10px 14px; background: #555; color: white; border-radius: 6px; text-decoration: none; font-weight: bold; }
.btn-reset:hover { background: #666; }

/* ── Table ──────────────────────────────────────────── */
.table-wrap, .table-container { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}
th {
    background: #1a1a1a;
    color: var(--primary);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid var(--primary);
}
th a { color: inherit; text-decoration: none; }
th a:hover { text-decoration: underline; }
th .sort-arrow { font-size: 0.75rem; margin-left: 4px; opacity: 0.7; }
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}
tr:hover td { background: #252525; }

/* ── Badges ─────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
}

/* Criticality badges */
.critical-max    { background: #800080; color: #fff; }
.critical-critic { background: #ff0000; color: #fff; }
.critical-high   { background: #ff4400; color: #fff; }
.critical-med    { background: #ff8800; color: #fff; }
.critical-low    { background: #ffcc00; color: #000; }
.normal          { background: #00aa00; color: #fff; }

/* Mode badges */
.badge-sim    { background: #003366; color: #66ccff; }
.badge-land   { background: #004400; color: #66ff66; }
.badge-hud    { background: #665500; color: #ffdd00; }
.badge-full,
.badge-global { background: #0066cc; color: #66ccff; }
.badge-object { background: #004400; color: #66ff66; }
.badge-na     { background: #333; color: #aaa; }

/* ── Code ───────────────────────────────────────────── */
code {
    background: var(--code-bg);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.85em;
    word-break: break-all;
}

/* ── Scores ─────────────────────────────────────────── */
.score-bl      { color: #ff4444; font-weight: bold; }
.score-wl      { color: #4caf50; font-weight: bold; }
.score-red     { color: #ff4444; font-weight: bold; }
.score-green   { color: #4caf50; font-weight: bold; }
.score-neutral { color: #aaa; font-weight: bold; }
.score-pos     { color: #00ff88; font-weight: bold; }
.score-neg     { color: #ff4444; font-weight: bold; }
.score-zero    { color: var(--muted); }

/* ── Error / Alert ──────────────────────────────────── */
.error {
    background: #440000;
    color: #cc2200;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #660000;
}
.alert       { padding: 10px 14px; border-radius: 6px; margin: 10px 0; font-size: 0.9rem; }
.alert-error { background: #2a0f0f; border: 1px solid #cc3333; color: #ff9090; }
.alert-ok    { background: #0f2a14; border: 1px solid var(--green); color: #90ff90; }

/* ── Empty state ────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
    font-style: italic;
}

/* ── BL / WL quick buttons ──────────────────────────── */
.btn-blwl {
    padding: 7px 12px;
    margin: 0 5px;
    border: 2px solid;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    min-width: 44px;
    text-align: center;
}
.btn-bl {
    background: transparent;
    color: #fff;
    border-color: #cc0000;
    box-shadow: 0 0 8px rgba(204, 0, 0, 0.4);
}
.btn-bl:hover {
    background: #cc0000;
    color: #fff;
    box-shadow: 0 0 15px rgba(204, 0, 0, 0.8);
    transform: scale(1.05);
}
.btn-wl {
    background: transparent;
    color: #fff;
    border-color: #00ff44;
    box-shadow: 0 0 8px rgba(0, 255, 68, 0.4);
}
.btn-wl:hover {
    background: #00ff44;
    color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 68, 0.8);
    transform: scale(1.05);
}
.btn-blwl.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none !important;
}
.btn-blwl.disabled:hover {
    transform: none;
    background: transparent !important;
    color: #fff !important;
}

/* ── Add / Delete buttons ───────────────────────────── */
.btn-add-top,
.btn-add-round {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    width: 30px; height: 30px;
    background: #00ff44; color: #fff;
    border: none; border-radius: 50%;
    font-size: 18px; font-weight: bold;
    cursor: pointer; vertical-align: middle;
    line-height: 1;
}
.btn-add-top:hover,
.btn-add-round:hover { background: #00cc33; }

.btn-delete {
    background: transparent;
    color: #fff;
    border: 2px solid #cc0000;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}
.btn-delete:hover { background: #cc0000; color: #fff; }

/* ── CRUD icon buttons ──────────────────────────────── */
.td-actions { white-space: nowrap; width: 70px; }
.btn-icon {
    border: none; background: transparent; cursor: pointer;
    font-size: 1rem; padding: 2px 6px; border-radius: 4px;
}
.btn-icon-edit { color: var(--blue); }
.btn-icon-edit:hover { background: rgba(52,152,219,.15); }
.btn-icon-del { color: var(--red-soft); }
.btn-icon-del:hover { background: rgba(220,53,69,.15); }

/* ── Popup (modals) ─────────────────────────────────── */
.popup-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 1000;
    align-items: center; justify-content: center;
}
.popup-box {
    background: var(--card);
    border: 1px solid var(--border2);
    border-radius: 10px;
    width: 440px;
    max-width: 92vw;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.popup-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: .8rem 1.2rem;
    border-bottom: 1px solid var(--border);
    font-weight: bold; font-size: .95rem; color: var(--text);
}
.popup-close {
    background: none; border: none; color: var(--muted);
    font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.popup-close:hover { color: var(--text); }
.popup-box form { padding: 1rem 1.2rem; }
.popup-field { margin-bottom: .8rem; }
.popup-field label {
    display: block; font-size: .82rem; color: var(--muted);
    margin-bottom: .3rem;
}
.popup-field input[type="text"],
.popup-field select {
    width: 100%; padding: 7px 10px;
    background: var(--input); color: var(--text);
    border: 1px solid var(--border); border-radius: 6px;
    font-size: .9rem;
}
.popup-field input:focus,
.popup-field select:focus {
    outline: none; border-color: var(--primary);
}
.popup-btns { display: flex; gap: .6rem; padding-top: .6rem; }
.popup-btn-save {
    padding: 7px 20px; border: none; border-radius: 6px;
    background: var(--green); color: #fff;
    font-weight: bold; cursor: pointer;
}
.popup-btn-save:hover { background: #1e8c3a; }
.popup-btn-cancel {
    padding: 7px 16px; border: 1px solid var(--border2); border-radius: 6px;
    background: transparent; color: var(--muted);
    cursor: pointer;
}
.popup-btn-cancel:hover { color: var(--text); border-color: var(--text); }

/* ── Pagination ─────────────────────────────────────── */
.pagination {
    margin: 1.5rem 0;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.pagination a {
    padding: 7px 12px;
    background: var(--input);
    color: #ccc;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.88rem;
}
.pagination a.active,
.pagination a:hover  { background: var(--primary); color: white; }

/* ── Stats table ────────────────────────────────────── */
.stats-table th { background: #1a1a1a; color: var(--primary); padding: 12px 10px; font-size: .9rem; }
.stats-table td { padding: 10px; text-align: center; font-weight: 500; }
.stats-table .total-row { background: #2a2a2a; font-weight: bold; }
.stats-table .total-row td { color: var(--primary); }

/* ── Logo header ────────────────────────────────────── */
.logo-header {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0.8rem;
    width: 100px;
    height: 100px;
}

/* ── Settings inputs ────────────────────────────────── */
.cfg-input {
    padding: 8px 12px;
    background: var(--input);
    border: 1px solid var(--border2);
    color: white;
    border-radius: 6px;
    font-size: 0.9rem;
}
.cfg-input:focus { outline: none; border-color: var(--primary); }

.cfg-toggle {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: 0.9rem; color: var(--text);
}
.cfg-toggle input[type="checkbox"] {
    width: 16px; height: 16px; cursor: pointer;
    accent-color: var(--primary);
}

/* ── Monitoring tiles (for future owner monitoring) ─── */
.mon-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }

.mon-metric {
    background: #252525; border: 1px solid var(--border);
    border-radius: 10px; padding: .9rem 1.1rem;
    min-width: 130px; flex: 1;
    display: flex; flex-direction: column; gap: 4px;
}
.mon-metric-label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.mon-metric-value { font-size: 1.35rem; font-weight: bold; color: var(--text); }
.mon-metric-sub   { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.mon-card {
    background: #252525; border: 1px solid var(--border);
    border-radius: 10px; padding: 1rem 1.2rem;
    min-width: 130px; flex: 1;
    display: flex; flex-direction: column; gap: 4px;
}
.mon-card-label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .5px; }
.mon-card-count { font-size: 1.65rem; font-weight: bold; color: var(--text); line-height: 1.1; }

.mon-badge    { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .76rem; font-weight: 700; }
.mon-ok     { background: #0f2a14; border: 1px solid #28a745; color: #90ff90; }
.mon-notice { background: #2a200a; border: 1px solid #e6a817; color: #ffd066; }
.mon-warn   { background: #2a1500; border: 1px solid #cc6600; color: #ffaa44; }
.mon-err    { background: #2a0f0f; border: 1px solid #cc3333; color: #ff9090; }

/* ── Charts ─────────────────────────────────────────── */
.mon-charts     { display: flex; gap: 1.5rem; align-items: stretch; margin-top: .5rem; }
.mon-chart-bar  { flex: 0 0 70%; min-width: 0; }
.mon-chart-pie  { flex: 0 0 calc(30% - 1.5rem); }
.mon-chart-wrap { position: relative; height: 260px; }
.mon-chart-wrap canvas { position: absolute; inset: 0; }

/* ── Burger menu toggle ────────────────────────────────── */
.burger {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
    .burger { display: block; }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 0;
        margin: 0;
        background: #1a1a1a;
        border-top: 1px solid var(--border);
    }
    .nav-links.open { display: flex; }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid var(--border);
    }
    .nav-links li a,
    .nav-links li .lang-selector {
        display: block;
        padding: 12px 16px;
        font-size: 1rem;
    }
    .nav-links .user-info { margin-left: 0; padding: 12px 16px; }
    .nav-links .lang-selector { margin-left: 0; }

    nav {
        flex-wrap: wrap;
    }

    .container { padding: 0 12px; }
    .mon-row { flex-direction: column; }
    .mon-charts { flex-direction: column; }
    .mon-chart-bar, .mon-chart-pie { flex: 1; }
}
