/* -------------------------------------------------------
   GLOBAL
------------------------------------------------------- */

:root {
    --bg-main: #f4f7fb;
    --bg-card: #ffffff;
    --bg-nav: #3b6ea8;
    --bg-nav-dark: #2f5b8b;

    --text-main: #1a1a1a;
    --text-light: #ffffff;
    --text-muted: #777;

    --border-color: #dfe5ec;

    --accent: #3b82f6;

    --status-ok: #1e9c5f;
    --status-warn: #e6a400;
    --status-error: #d13a3a;

    --shadow-soft: 0 2px 8px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
}

/* -------------------------------------------------------
   NAVBAR
------------------------------------------------------- */

.nav {
    background: var(--bg-nav);
    color: var(--text-light);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-soft);
}

.nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    opacity: 0.95;
}

.nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

.nav-right {
    margin-left: auto;
    font-size: 14px;
}

/* -------------------------------------------------------
   MAIN CONTAINER
------------------------------------------------------- */

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 30px;
    background: var(--bg-card);
    border-radius: 6px;
    box-shadow: var(--shadow-soft);
}

/* -------------------------------------------------------
   HEADINGS
------------------------------------------------------- */

h1, h2, h3 {
    margin-top: 0;
    color: #2d3e50;
}

/* -------------------------------------------------------
   TABLES
------------------------------------------------------- */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
}

thead {
    background: #eef3f9;
}

th {
    text-align: left;
    padding: 12px;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: #f7f9fc;
}

/* module link */

td a {
    color: var(--accent);
    font-weight: 500;
}

td a:hover {
    text-decoration: underline;
}

/* -------------------------------------------------------
   STATUS BADGES
------------------------------------------------------- */

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-ok {
    background: #e7f7ef;
    color: var(--status-ok);
}

.badge-warn {
    background: #fff5d8;
    color: var(--status-warn);
}

.badge-error {
    background: #fde7e7;
    color: var(--status-error);
}

/* -------------------------------------------------------
   DETAIL TABLE (MODULE PAGE)
------------------------------------------------------- */

.detail-table {
    width: 100%;
    margin-top: 20px;
}

.detail-table th {
    width: 220px;
    color: #444;
    background: #f5f7fa;
}

/* -------------------------------------------------------
   FORMS
------------------------------------------------------- */

label {
    display: block;
    margin-top: 14px;
    font-weight: 600;
    font-size: 14px;
}

input,
select {
    margin-top: 6px;
    padding: 8px 10px;
    width: 280px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 14px;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

/* -------------------------------------------------------
   BUTTONS
------------------------------------------------------- */

button {
    margin-top: 18px;
    padding: 10px 18px;
    background: var(--accent);
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: #2c6edb;
}

/* -------------------------------------------------------
   FLASH MESSAGES
------------------------------------------------------- */

.flash-success {
    background: #e8f7ef;
    border-left: 4px solid var(--status-ok);
    padding: 10px 14px;
    margin-bottom: 16px;
}

.flash-danger {
    background: #fdeaea;
    border-left: 4px solid var(--status-error);
    padding: 10px 14px;
    margin-bottom: 16px;
}

/* -------------------------------------------------------
   MONO TEXT
------------------------------------------------------- */

.mono {
    font-family: "Courier New", monospace;
    background: #f5f5f5;
    padding: 4px 6px;
    border-radius: 4px;
}

/* -------------------------------------------------------
   MODULE CARD (optional future)
------------------------------------------------------- */

.card {
    background: white;
    border-radius: 6px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

.map-card {
    margin-top: 24px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-soft);
}

.map-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3e50;
}

#module-map {
    width: 100%;
    height: 420px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.map-note {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 13px;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    vertical-align: baseline;
}

.link-button:hover {
    text-decoration: underline;
}

.link-button-delete {
    color: #d13a3a;
}

.link-button-delete:hover {
    color: #b02a2a;
}


.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.card-title {
    margin-top: 0;
    margin-bottom: 14px;
    color: #2d3e50;
}

#dashboard-map {
    width: 100%;
    height: 460px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.badge-online {
    background: #e7f7ef;
    color: #1e9c5f;
}

.badge-offline {
    background: #fde7e7;
    color: #d13a3a;
}

.badge-base {
    background: #e8f0ff;
    color: #2457a6;
}

.badge-fix {
    background: #e7f7ef;
    color: #157347;
}

.badge-float {
    background: #fff3cd;
    color: #9a6700;
}

.badge-single {
    background: #f2f2f2;
    color: #666;
}

.badge-dgps {
    background: #e9f7ff;
    color: #0b6aa2;
}

.badge-warn {
    background: #fff3cd;
    color: #8a6700;
}

.badge-neutral {
    background: #eef1f4;
    color: #5c6873;
}

.text-muted {
    color: var(--text-muted);
}

.row-offline td {
    opacity: 0.85;
}

.custom-map-marker-wrapper {
    background: transparent;
    border: none;
}

.map-marker {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.18);
}

.map-marker-online {
    background: #1e9c5f;
}

.map-marker-offline {
    background: #d13a3a;
}

@media (max-width: 900px) {
    #dashboard-map {
        height: 320px;
    }
}

/* -------------------------------------------------------
   RESPONSIVE
------------------------------------------------------- */

@media (max-width: 900px) {

    .container {
        margin: 15px;
        padding: 20px;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 8px;
    }

}
