/* assets/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
    /* --- Elite Color System --- */
    --bg-body: #0B0F14;
    /* Deep charcoal */
    --bg-surface: #121826;
    /* Soft elevated panels */

    --primary: #2563EB;
    /* Executive blue */
    --secondary: #22C55E;
    /* Controlled success green */

    --text-primary: #E5E7EB;
    /* Soft white */
    --text-secondary: #9CA3AF;
    /* Muted gray */
    --text-meta: #6B7280;
    /* Disabled/Meta */

    --border: #1F2937;
    --border-hover: #374151;

    /* --- Shadows --- */
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.25);

    /* --- Spacing --- */
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1280px;
    /* 1200-1320px range */
    margin: 0 auto;
    padding: 80px 20px;
    /* 80px vertical padding desktop */
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
}

h1 {
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 24px;
    font-weight: 500;
}

a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary);
}

/* --- Header --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 40px;
    margin-bottom: 60px;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.user-badge {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Components: Elite Cards --- */
.glass-panel,
.intel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-card);
    margin-bottom: 40px;
    /* Remove old glass effects */
    backdrop-filter: none;
}

/* Forms - Purpose First */
.action-grid {
    display: grid;
    grid-template-columns: 3fr 2fr auto;
    gap: 20px;
}

input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-body);
    /* Dark surface */
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    /* Clear focus ring */
}

input::placeholder {
    color: var(--text-meta);
}

button,
.btn-primary {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    font-weight: 500;
    font-size: 15px;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: filter 0.2s;
    text-align: center;
    text-transform: none;
    /* No forced uppercase */
}

button:hover,
.btn-primary:hover {
    filter: brightness(1.1);
    /* Slight brightness increase */
    transform: none;
    /* No animation-heavy moves */
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-small:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: transparent;
}

/* Danger Action */
a[href*="delete"] .btn-small {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

a[href*="delete"] .btn-small:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* --- Tables --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    text-align: left;
    color: var(--text-meta);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 15px;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

strong {
    color: var(--text-primary);
    font-weight: 500;
}

.status-tag {
    background: transparent;
    color: var(--secondary);
    font-weight: 500;
    font-size: 13px;
}

/* --- Intel Grid --- */
.intel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    /* Optimized for smaller screens */
    gap: 30px;
}

.intel-card {
    margin: 0;
    /* Reset */
    padding: 32px;
}

.intel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 15px;
}

.label {
    color: var(--text-meta);
}

.val {
    color: var(--text-primary);
    text-align: right;
    font-feature-settings: "tnum";
}

/* Map */
#map {
    height: 280px;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 24px 0;
    /* Saturation reduction for professional look */
    filter: saturate(0.8);
}

/* Mobile */
@media screen and (max-width: 768px) {
    .container {
        padding: 48px 20px;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    /* Stack tables */
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 24px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
    }

    td {
        border-bottom: 1px solid var(--border);
        display: flex;
        justify-content: space-between;
        align-items: center;
        /* Better vertical align */
        padding: 16px 20px;
        text-align: right;
    }

    td:before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-meta);
        font-size: 13px;
        margin-right: 12px;
    }
}

/* Extra Small Devices (iPhone SE, Foldables) */
@media screen and (max-width: 380px) {
    .container {
        padding: 32px 16px;
    }

    .intel-grid {
        grid-template-columns: 1fr;
    }

    /* Allow horizontal scroll if needed or wrap text */
    td {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 6px;
    }

    td:before {
        margin-bottom: 4px;
    }

    .val {
        text-align: left;
    }
}

@media print {
    body {
        background: white;
        color: black;
    }

    .glass-panel,
    .intel-card {
        border: 1px solid #ddd;
        background: white;
        color: black;
        box-shadow: none;
    }

    .val,
    strong {
        color: black !important;
    }
}