/* CSS Reset & Variables */
:root {
    /* Light Tech Palette */
    --bg-main: #f8fafc;
    /* Slate 50 */
    --bg-card: #ffffff;
    /* White */
    --bg-card-hover: #f1f5f9;
    /* Slate 100 */
    --border: #e2e8f0;
    /* Slate 200 */
    --text-primary: #0f172a;
    /* Slate 900 */
    --text-secondary: #64748b;
    /* Slate 500 */
    --accent: #0f172a;
    /* Slate 900 (Professional Dark Blue/Black) */
    --accent-hover: #1e293b;
    /* Slate 800 */
    --accent-light: #eff6ff;
    /* Blue 50 */

    /* Login Specific */
    --login-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);

    /* Status Colors (Clean & crisp) */
    --status-urgent-bg: #fef2f2;
    --status-urgent-border: #fecaca;
    --status-urgent-text: #dc2626;
    /* Red 600 */

    --status-delivered-bg: #f0fdf4;
    --status-delivered-border: #bbf7d0;
    --status-delivered-text: #16a34a;
    /* Green 600 */

    --status-pending-bg: #fefce8;
    --status-pending-border: #fef08a;
    --status-pending-text: #ca8a04;
    /* Yellow 600 */

    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

/* === LOGIN PAGE STYLES === */
.login-body {
    background: var(--login-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-hover);
    text-align: center;
}

.login-logo {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    padding: 1rem;
    background: var(--bg-main);
    border-radius: 50%;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* === DASHBOARD LAYOUT === */
header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-soft);
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0 0.5rem;
}

.nav-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

/* === FILTERS BAR === */
.filters-bar {
    padding: 1.5rem 2rem;
    background: var(--bg-main);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.search-field {
    flex: 2;
    min-width: 250px;
}

.filter-select,
.filter-date {
    flex: 1;
    min-width: 150px;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

input,
select {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

/* === GRID SYSTEM === */
.main-content {
    padding: 2rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

/* Urgent Styling */
.card.urgent {
    border-left: 4px solid var(--status-urgent-text);
    background: linear-gradient(to right, #fff5f5, #fff);
}

/* Card Content */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.apt-badge {
    background: var(--bg-card-hover);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.card-body h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.pending {
    background: var(--status-pending-bg);
    color: var(--status-pending-text);
    border: 1px solid var(--status-pending-border);
}

.status-badge.delivered {
    background: var(--status-delivered-bg);
    color: var(--status-delivered-text);
    border: 1px solid var(--status-delivered-border);
}

.status-badge.urgent {
    background: var(--status-urgent-bg);
    color: var(--status-urgent-text);
    border: 1px solid var(--status-urgent-border);
}

/* Buttons & FAB */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    width: 100%;
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.btn-outline:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 2rem;
    border: none;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    z-index: 500;
}

.fab:hover {
    transform: scale(1.1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.text-xs {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Responsiveness */
@media (max-width: 768px) {
    .filters-bar {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
}