/* Custom Properties */
:root {
    --primary: #F46E22; /* Vibrant orange for accents */
    --secondary: #234E67; /* Deep blue for headers, navigation */
    --neutral-bg: #f9f9f9; /* Light grey background */
    --neutral-border: #e0e0e0; /* Border and divider */
    --neutral-text-secondary: #aaaaaa; /* Secondary text */
    --neutral-text-primary: #444; /* Primary text */
    --space-1: 0.25rem; /* 4px */
    --space-2: 0.5rem; /* 8px */
    --space-3: 0.75rem; /* 12px */
    --space-4: 1rem; /* 16px */
    --space-6: 1.5rem; /* 24px */
    --space-8: 2rem; /* 32px */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    --font-size-sm: 0.875rem; /* 14px */
    --font-size-base: 1rem; /* 16px */
    --font-size-lg: 1.25rem; /* 20px */
    --font-size-xl: 1.5rem; /* 24px */
    --line-height: 1.5;
}

/* Global Styles (Mobile-First) */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--neutral-text-primary);
    background-color: var(--neutral-bg);
}

/* Component: Container */
.container {
    max-width: 100%;
    padding: var(--space-2);
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .container {
        max-width: 1800px;
        padding: var(--space-4);
    }
}

/* Component: Heading */
.heading {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: var(--space-6);
}

/* Component: Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-3);
    }
}

.stat-card {
    background-color: var(--secondary);
    color: white;
    padding: var(--space-3);
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

    .stat-card:hover {
        transform: translateY(-2px);
    }

.stat-card__title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.stat-card__value {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

/* Component: Log Card Container */
.log-container {
    background-color: white;
    border-radius: 0.5rem;
    padding: var(--space-4);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Component: Column Headers */
.headers {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--neutral-border);
    margin-bottom: var(--space-4);
}
/* Remove conflicting comma-based rules and consolidate */
.header-type, .log-card__field .field-type {
    min-width: 150px; /* Adjusted for "Type" header */
    max-width: 150px; /* Allow some flexibility for content */
    width: auto;
    display: block;
    text-align: left;
    flex: none; /* Prevent flex stretching */
}

.header-directionid, .log-card__field .field-directionid {
    min-width: 120px; /* Adjusted for "DirectionID" header */
    max-width: 120px;
    width: auto;
    display: block;
    text-align: left;
    flex: none; /* Prevent flex stretching */
}

.header-createdat, .log-card__field .field-createdat {
    min-width: 150px; /* Adjusted for "DirectionID" header */
    max-width: 150px;
    width: auto;
    display: block;
    text-align: left;
    flex: none; /* Prevent flex stretching */
}

.header-docid, .log-card__field .field-docid {
    min-width: 540px; /* Adjusted for "DirectionID" header */
    max-width: 540px;
    width: auto;
    display: block;
    text-align: left;
    flex: none; /* Prevent flex stretching */
}

.header-status, .log-card__field .field-status {
    min-width: 540px; /* Adjusted for "DirectionID" header */
    max-width: 540px;
    width: auto;
    display: block;
    text-align: left;
    flex: none; /* Prevent flex stretching */
}

/* General rule for other fields, avoiding conflict */
.log-card__field {
    flex: 1;
    min-width: 100px;
    padding: 0 var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--neutral-text-primary);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

    /* Remove redundant rules */
    .log-card__field.field-type, .log-card__field.field-directionid {
        flex: none; /* Ensure specific columns don’t stretch */
    }




.header {
    position: relative;
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--secondary);
    text-align: left;
    flex: 1;
    min-width: 120px;
    cursor: pointer;
    background-color: var(--neutral-bg);
    border-radius: 0.25rem;
    margin: 0 var(--space-1);
    transition: background-color 0.2s ease;
}

    .header:hover {
        background-color: #e6f0fa;
    }

    .header:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }

/* Component: Dropdown */
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid var(--neutral-border);
    border-radius: 0.25rem;
    padding: var(--space-3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    width: 200px;
}

.dropdown--active {
    display: block;
}

.dropdown__label {
    font-size: var(--font-size-sm);
    color: var(--neutral-text-primary);
    margin-bottom: var(--space-1);
    display: block;
}

.dropdown__input,
.dropdown__select {
    width: 100%;
    padding: var(--space-2);
    border: 1px solid var(--neutral-border);
    border-radius: 0.25rem;
    font-size: var(--font-size-sm);
    color: var(--neutral-text-primary);
    background-color: white;
    transition: border-color 0.2s ease;
}

    .dropdown__input:focus-visible,
    .dropdown__select:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
        border-color: var(--primary);
    }

.dropdown__group {
    margin-bottom: var(--space-2);
}

/* Component: Log Card */
.log-card {
    display: flex;
    flex-direction: row;
    padding: var(--space-3);
    margin-bottom: var(--space-3);
    border-radius: 0.5rem;
    background-color: white;
    border-left: 4px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

    .log-card:hover {
        transform: translateY(-2px);
        border-color: var(--primary);
    }

.log-card--success {
    border-left-color: var(--secondary);
    background-color: #f1f5f9;
}

.log-card--failure {
    border-left-color: var(--primary);
    background-color: var(--neutral-bg);
}

.log-card__field {
    flex: 1;
    min-width: 100px;
    padding: 0 var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--neutral-text-primary);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Component: Form Group */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

/* Component: Button */
.btn {
    padding: var(--space-2) var(--space-4);
    border-radius: 0.25rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: white;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

    .btn:hover {
        transform: scale(1.05);
    }

    .btn:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }

.btn--primary {
    background-color: var(--primary);
}

.btn--secondary {
    background-color: var(--secondary);
}

/* Component: Navbar */
.navbar {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: var(--space-3) 0;
}

.navbar-brand {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--secondary);
    text-decoration: none;
}

    .navbar-brand:hover {
        color: var(--primary);
    }

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--space-4);
}

.nav-item {
    display: flex;
    align-items: center;
}

.nav-link {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--secondary);
    text-decoration: none;
    padding: var(--space-2) var(--space-3);
    border-radius: 0.25rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

    .nav-link:hover,
    .nav-link:focus-visible {
        color: var(--primary);
        background-color: #e6f0fa;
    }

    .nav-link:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }

/* Component: Footer */
.footer {
    margin-top: var(--space-8);
    padding: var(--space-4) 0;
    border-top: 1px solid var(--neutral-border);
    text-align: center;
    color: var(--neutral-text-secondary);
}

/* Accessibility Enhancements */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Utility Classes */
.text-left {
    text-align: left;
}

.p-2 {
    padding: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.justify-end {
    justify-content: flex-end;
}

.text-lg {
    font-size: var(--font-size-lg);
}

.font-semibold {
    font-weight: 600;
}

.text-red-500 {
    color: #ef4444;
}

.border-red-500 {
    border-color: #ef4444;
}

.hidden {
    display: none;
}
