/* ATLAS Tool Styles - Industrial Defense Theme */
:root {
    /* Colors */
    --primary-color: #10b981;
    /* Matched to Status Available */
    --primary-hover: #059669;
    --bg-color: #000000;
    --bg-column: #121212;
    /* Slightly lighter than black */
    --card-bg: #050505;

    --text-main: #ffffff;
    --text-secondary: #cccccc;
    /* Lighter grey */
    --border-color: #333333;
    --border-panel: #333333;
    /* Explicit panel border color */

    --header-height: 60px;

    /* Status Colors (Restored Originals) */
    --status-ordered: #8b5cf6;
    /* Purple */
    --status-available: #10b981;
    /* Green */
    --status-assigned: #3b82f6;
    /* Blue */
    --status-out-service: #ef4444;
    /* Red */
    --status-demobilized: #6b7280;
    /* Grey */

    /* Typography */
    --font-ui: 'JetBrains Mono', monospace;
    --font-head: 'Oswald', sans-serif;
}

* {
    border-radius: 0 !important;
    /* Hard Edges */
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-ui);
    color: var(--text-main);
    background-color: var(--bg-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Modals & Forms */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    width: 95%;
    max-width: 600px;
    background: var(--bg-color);
    /* Black background */
    border: 1px solid var(--border-panel);
    /* Dark border */
    color: var(--text-main);
    /* White text */
    padding: 2rem;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header h2 {
    color: var(--text-main);
    margin-top: 0;
}

/* Grid Form Layout */
.resource-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    /* 3 columns */
    gap: 0.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group.full-width {
    grid-column: span 3;
}

.form-group.span-2 {
    grid-column: span 2;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-section-header {
    grid-column: span 3;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid #f3f4f6;
    letter-spacing: 0.05em;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    background: var(--bg-column);
    /* Dark input background */
    border: 1px solid var(--border-panel);
    color: var(--text-main);
    /* White text */
    border-radius: 0.375rem;
    padding: 0.5rem;
    font-size: 0.875rem;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
    outline: none;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
    border-top: 1px solid var(--border-panel);
    padding-top: 1rem;
}

/* Header */
.header {
    background: var(--bg-color);
    /* Black */
    /* border-bottom: 1px solid white; Removed */
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.title-section {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.title-section h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.025em;
}

.title-section p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.brand-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s;
}

.brand-link:hover {
    color: var(--primary-color);
}

.brand-divider {
    color: var(--border-color);
    font-weight: 300;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Column Header Pax Badge */
.pax-badge {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 0.25rem;
    font-weight: 400;
    font-family: var(--font-mono);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    /* Use flex alignment instead of padding */
    height: 36px;
    /* Explicit height */
    /* ... rest unchanged */
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: none;
}

.btn-primary:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
    /* Black text on green */
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid white;
    color: white;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--bg-color);
    /* Black text on neon green */
}

/* Container */
.container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* Board Layout */
/* Board Layout */
.board-container {
    flex: 1;
    overflow-x: auto;
    padding: 0.5rem 1.5rem;
    /* Reduced vertical padding (0.5rem), kept side padding (1.5rem) */
    display: flex;
    gap: 1.5rem;
    /* Match header padding */
    align-items: stretch;
    /* Stretch columns to full height */
    /* Remove fixed calc height to allow flex to handle footer */
}

.status-column {
    background: var(--bg-column);
    /* Dark Grey */
    border: none;
    /* Remove White Outline */
    padding: 0;
    /* Remove padding so header touches edges */
    /* width: 300px;  Removed fixed width */
    min-width: 300px;
    /* Slightly reduced min-width */
    flex: 1 0 0;
    /* Force equal widths (basis 0), ignore content size */
    /* Flex grow, don't shrink */
    display: flex;
    flex-direction: column;
    /* max-height: 100%; Removed to allow scrolling inside if needed */
    height: 100%;
    border-radius: 6px !important;
    /* Force override of global hard edges */
    overflow: hidden;
    /* Clip header/content */
}

.column-header {
    padding: 0.5rem 1rem;
    /* Reduced height */
    border-bottom: none;
    /* Remove white line */
    /* Separation from content */
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    /* Ensure text is visible on colored headers */
}

.column-header h3 {
    font-size: 1.125rem;
    /* Increased from 0.875rem */
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 0.05em;
    font-family: var(--font-head);
    display: flex;
    align-items: center;
    /* Center badges */
}

.header-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.count-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.column-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Drag and Drop Visuals */
.column-content.drag-over {
    background-color: rgba(255, 255, 255, 0.1);
    /* Subtle highlight */
    /* box-shadow removed */
}

.resource-card.dragging {
    opacity: 0.6;
    transform: scale(0.98);
}

/* Resource Card */
.resource-card {
    background: var(--card-bg);
    /* Almost black #050505 */
    border: 1px solid white;
    /* Full Solid White */
    border-left-width: 4px;
    /* Thicker Status Line */
    padding: 1rem 1rem 0.25rem 1rem;
    /* Reduced bottom padding for tight arrow */
    cursor: grab;
    transition: background-color 0.2s;
    /* Only animate bg */
    position: relative;
    box-shadow: none;
    /* Flat look */
}

.resource-card:hover {
    background: #111;
    /* Lighten slightly on hover */
    /* No border color change */
}

/* Header Colors */
.column-header.ordered {
    background: var(--status-ordered);
    color: white;
}

.column-header.available {
    background: var(--status-available);
    color: white;
}

.column-header.assigned {
    background: var(--status-assigned);
    color: white;
}

.column-header.out-of-service {
    background: var(--status-out-service);
    color: white;
}

.column-header.demobilized {
    background: var(--status-demobilized);
    color: white;
}

.column-content {
    padding: 0.75rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.column-content:empty::after {
    content: "No resources";
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem 1rem;
    display: block;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Drag and Drop Visuals */


.resource-card.dragging {
    opacity: 0.6;
    transform: scale(0.98);
}

/* Resource Cards - Status Borders preserved */
.resource-card.ordered {
    border-left-color: var(--status-ordered);
}

.resource-card.available {
    border-left-color: var(--status-available);
}

.resource-card.assigned {
    border-left-color: var(--status-assigned);
}

.resource-card.out-of-service {
    border-left-color: var(--status-out-service);
}

.resource-card.demobilized {
    border-left-color: var(--status-demobilized);
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-panel);
    /* Divider line */
}

.resource-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

/* Request Number Box */
.request-number-badge {
    background: transparent;
    color: white;
    /* Pure White Text */
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
    border: 1px solid white;
    /* White Rectangle */
    font-weight: 700;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    font-family: var(--font-mono);
    display: inline-block;
    min-width: 30px;
    text-align: center;
}

/* Typography Hierachy */
.resource-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.1rem;
    /* Larger */
    line-height: 1.25;
    margin-left: 0;
    /* Fix spacing/alignment */
}

/* Dim Labels */
.assignment-box strong,
.resource-contact-compact strong,
.label-text {
    color: var(--text-muted);
    /* Dimmed Labels */
    font-weight: 400;
}

.resource-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: 0.5rem;
}

.resource-card:hover .resource-actions {
    opacity: 1;
}

.icon-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.icon-btn:hover {
    background: transparent;
    /* No background change */
    color: var(--text-main);
}

.icon-btn.delete:hover {
    background: transparent;
    /* No background change */
    color: #ef4444;
}

.resource-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

/* Badge Tweaks */
/* Badge Tweaks - Lined Look */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    padding: 0;
    margin-right: 0.75rem;
    /* Spacing instead of box */
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.2;
    font-family: var(--font-mono);
    opacity: 0.9;
}

.badge.pax {
    background: transparent;
    color: #10b981;
    border: none;
    gap: 0.25rem;
}

.assignment-box {
    background: transparent;
    border-top: 1px solid var(--border-panel);
    border-bottom: 1px solid var(--border-panel);
    border-left: none;
    border-right: none;
    color: var(--primary-color);
    padding: 0.5rem 0;
    /* Vertical padding only */
    border-radius: 0;
    font-size: 0.75rem;
    margin: 0.5rem 0;
    font-weight: 500;
    font-family: var(--font-mono);
}

.resource-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.data-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.data-row.urgent {
    color: var(--accent-danger);
    font-weight: 600;
}

/* Icons Dimming */
.data-row svg,
.resource-contact-compact div svg {
    color: var(--text-muted);
    opacity: 0.7;
}

.resource-contact-compact {
    border-top: 1px solid var(--border-panel);
    margin-top: 0.75rem;
    /* More space */
    padding-top: 0.5rem;
    font-size: 0.75rem;
    /* Slightly larger */
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    /* More gap */
}

.resource-contact-compact div {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.resource-notes-compact {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.25rem;
    border-top: 1px dashed var(--border-panel);
    padding-top: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        height: auto;
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
        /* Full width */
    }

    .header-content {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        /* Allow wrapping */
        gap: 0.5rem;
        justify-content: flex-start;
        /* Align left */
    }

    /* Make buttons flexible or smaller on mobile if needed */
    .header-actions .btn {
        flex: 1;
        /* Stretch buttons to fill lines */
        justify-content: center;
        white-space: nowrap;
    }

    /* Resource count might need its own line */
    .resource-count {
        width: 100%;
        text-align: center;
        margin-bottom: 0.25rem;
    }

    .status-columns {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .status-column {
        flex: none;
        width: 100%;
    }

    .modal-content {
        padding: 1rem;
        width: 100%;
        /* Full width modal */
        margin: 1rem;
        /* Margin from edges */
    }

    .resource-form {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    .form-group.span-2,
    .form-group.full-width {
        grid-column: span 1;
    }

    .form-section-header {
        grid-column: span 1;
    }
}

/* Collapsible Details */
.card-details-collapsible {
    display: none;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-panel);
    animation: fadeIn 0.2s ease-in-out;
}

.resource-card.expanded .card-details-collapsible {
    display: flex;
    flex-direction: column;
}

.toggle-expand-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: color 0.2s;
    margin-top: 0.25rem;
}

.toggle-expand-btn:hover {
    color: var(--primary-color);
}

.toggle-expand-btn svg {
    transition: transform 0.2s;
}

.resource-card.expanded .toggle-expand-btn svg {
    transform: rotate(180deg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}