:root {
    --primary-color: #e63946;
    --secondary-color: #1d1d1d;
    --accent-color: #a8dadc;
    --text-color: #f1faee;
    --bg-color: #0c0c0c;
    --card-bg: #1a1a1a;
    --border-color: #333;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

header {
    background-color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #c92a3a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

.btn-secondary {
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #444;
}

.btn-secondary:hover {
    background-color: #444;
    color: white;
    border-color: #555;
}

.btn-export {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 1px solid #047857;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-export:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
    border-color: #059669;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s ease;
}

.card:hover {
    border-color: var(--primary-color);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

tr:hover {
    background-color: #222;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: #111;
    color: white;
    box-sizing: border-box;
}

input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.category-title {
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 2rem 0 1rem;
}

/* Custom File Upload */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 1.5rem;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #111;
    border: 2px dashed #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-upload-label:hover {
    border-color: var(--primary-color);
    background: #1a1a1a;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.file-upload-text {
    font-size: 0.9rem;
    color: #888;
}

.file-name-display {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* Import Page Specific Refinements */
.import-guide-box {
    background: #080808;
    border: 1px solid #222;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

.import-guide-title {
    font-size: 0.75rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
    font-weight: bold;
}

.import-code-sample {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.4;
}

.import-hint {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    margin-top: 1rem;
    display: block;
}

/* --- Responsive Foundations --- */
/* --- Responsive Foundations --- */
@media (max-width: 1024px) {
    header {
        flex-direction: column;
        padding: 1rem;
        text-align: center;
    }

    .header-brand {
        flex-direction: column !important;
        width: 100% !important;
        text-align: center;
        margin-bottom: 1rem;
    }

    header h1 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    nav a {
        margin: 0;
        padding: 0.5rem;
        font-size: 0.85rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 4px;
    }

    .container {
        margin: 1rem auto;
    }

    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Fixed Column Layouts (like orders.php) */
    .flex-row-responsive {
        flex-direction: column !important;
    }

    .flex-col-responsive {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 1rem !important;
    }

    /* Table Responsiveness */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
        border-radius: 8px;
        border: 1px solid var(--border-color);
    }

    table {
        min-width: 600px;
        /* Force scroll on small screens */
    }

    th,
    td {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    /* Button stacking */
    .btn-group-responsive {
        flex-direction: column !important;
        width: 100%;
    }

    .btn-group-responsive .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1rem;
    }

    .card {
        padding: 1rem;
    }
}