/* ==========================================================================
   Base & Reset
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-page: #f1f5f9;
    --bg-surface: #ffffff;
    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --accent: #475569;
    --accent-hover: #334155;
    --accent-active: #1e293b;

    --status-online: #10b981;
    --status-offline: #94a3b8;

    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius-sm: 4px;
    --radius-md: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding: 32px 16px;
}

/* ==========================================================================
   Layout Container (Centered)
   ========================================================================== */
.container {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==========================================================================
   Header Section
   ========================================================================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.dashboard-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dashboard-header .subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--status-online);
    border-radius: 50%;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* ==========================================================================
   Map Section (Reserved Placeholder) This one it the configuration required for google maps to work properly
   ========================================================================== */

.map-container {
        position: relative;
        width: 100%;
        height: 400px;
    }
    
    #map {
        width: 100%;
        height: 100%;
    }
    
    /* Center Crosshair Target */
    .map-center-crosshair {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 24px;
        height: 24px;
        transform: translate(-50%, -50%);
        pointer-events: none; /* Mouse clicks pass directly through to the map */
        z-index: 10;
    }
    
    .map-center-crosshair::before,
    .map-center-crosshair::after {
        content: "";
        position: absolute;
        background-color: #ef4444; /* Red reticle */
    }
    
    /* Horizontal crosshair line */
    .map-center-crosshair::before {
        top: 11px;
        left: 0;
        width: 24px;
        height: 2px;
    }
    
    /* Vertical crosshair line */
    .map-center-crosshair::after {
        top: 0;
        left: 11px;
        width: 2px;
        height: 24px;
    }


/* ==========================================================================
   Table Section
   ========================================================================== */
.section-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-toolbar h2 {
    margin-bottom: 0;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

thead tr {
    border-bottom: 2px solid var(--border-subtle);
}

th {
    padding: 10px 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: #f8fafc;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

tbody tr:last-child td {
    border-bottom: none;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 14px;
}

/* ==========================================================================
   Form & Controls
   ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="number"],
input[type="text"] {
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    background-color: var(--bg-surface);
    outline: none;
    transition: border-color 0.15s ease;
}

input[type="number"]:focus,
input[type="text"]:focus {
    border-color: var(--accent);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-feedback {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    transition: background-color 0.15s ease;
}

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

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

.btn-primary:active {
    background-color: var(--accent-active);
}

.btn-secondary {
    background-color: var(--bg-page);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background-color: var(--border-subtle);
}
