:root {
    --primary: #FF6B35;
    --primary-dark: #E55525;
    --secondary: #004E89;
    --accent: #F7B801;
    --success: #06D6A0;
    --danger: #EF476F;
    --dark: #1A1A2E;
    --gray: #6C757D;
    --light: #F8F9FA;
    --white: #FFFFFF;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 1rem;
    color: var(--dark);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.6s ease;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.logo-icon {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

.title {
    font-family: 'Bebas Neue', cursive;
    font-size: 2rem;
    color: var(--white);
    letter-spacing: 2px;
    text-shadow: 4px 4px 8px var(--shadow-lg);
}

.subtitle {
    color: var(--white);
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

.card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 40px var(--shadow-lg);
    overflow: hidden;
    animation: fadeInUp 0.6s ease;
    margin-bottom: 1.5rem;
}

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-header.admin-header {
    background: linear-gradient(135deg, var(--secondary) 0%, #0062ad 100%);
}

.card-title {
    font-family: 'Bebas Neue', cursive;
    font-size: 1.3rem;
    color: var(--white);
    letter-spacing: 1px;
}

.badge {
    background: var(--white);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge.admin-badge {
    color: var(--secondary);
}

.card-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.85rem;
}

.input-field {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #E9ECEF;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    background: var(--light);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.select-field {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.btn {
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 107, 53, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #05b88a 100%);
    color: var(--white);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(6, 214, 160, 0.4);
}

.btn-sm {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

.btn-icon {
    font-size: 1.1rem;
}

/* Search and Filter Styles */
.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-box {
    position: relative;
}

.search-box input {
    padding-left: 2.5rem;
}

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--gray);
}

/* List Card Styles */
.admin-lists {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}



.list-card.has-divergence {
    border: 3px solid var(--danger);
    box-shadow: 0 4px 20px rgba(239, 71, 111, 0.3);
}

.list-card-header {
    background: linear-gradient(135deg, var(--secondary) 0%, #0062ad 100%);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.list-card-header.divergence-header {
    background: #ee0202;
}

.list-card-title {
    font-weight: 700;
    color: var(--white);
    font-size: 1.1rem;
}

.list-card-date {
    color: var(--white);
    opacity: 0.9;
    font-size: 0.8rem;
}

.divergence-badge {
    background: var(--white);
    color: var(--danger);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.approved {
    background: #d4edda;
    color: #155724;
}

.status-badge.rejected {
    background: #f8d7da;
    color: #721c24;
}

.list-card-body {
    padding: 1rem;
}

.list-message {
    background: #fff3cd;
    border-left: 4px solid var(--accent);
    padding: 0.8rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #856404;
}

.list-message.divergence-message {
    background: #f8d7da;
    border-left-color: var(--danger);
    color: #721c24;
    font-weight: 600;
}

.list-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem;
    background: var(--light);
    border-radius: 8px;
    font-size: 0.9rem;
}

.list-item-info {
    flex: 1;
}

.list-item-category {
    font-size: 0.7rem;
    color: var(--gray);
    text-transform: uppercase;
}

.list-item-model {
    font-weight: 600;
    color: var(--dark);
}

.list-item-quantity {
    font-weight: 700;
    color: var(--secondary);
    white-space: nowrap;
}

.list-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 2px dashed #DEE2E6;
}

.list-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.7rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    color: var(--white);
}

.approve-btn {
    background: var(--success);
}

.approve-btn:hover {
    background: #05b88a;
    transform: translateY(-1px);
}

.delete-list-btn {
    background: var(--danger);
}

.delete-list-btn:hover {
    background: #d63557;
    transform: translateY(-1px);
}

.pdf-btn {
    background: #dc3545;
}

.pdf-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.excel-btn {
    background: #28a745;
}

.excel-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.print-btn {
    background: #17a2b8;
}

.print-btn:hover {
    background: #138496;
    transform: translateY(-1px);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 0.8rem;
    opacity: 0.3;
}

.empty-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 0.4rem;
}

.empty-subtext {
    color: var(--gray);
    opacity: 0.7;
    font-size: 0.8rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Responsive */
@media (min-width: 768px) {
    .title {
        font-size: 3rem;
    }

    .logo-icon {
        font-size: 3rem;
    }
}

@media (max-width: 767px) {
    :root {
        --app-bg: #F3F5F8;
        --app-border: #E4E8EF;
    }

    html {
        background: var(--app-bg);
    }

    body {
        min-height: 100svh;
        padding: 0;
        background: var(--app-bg);
        color: var(--dark);
        -webkit-tap-highlight-color: transparent;
    }

    body::before {
        content: "";
        position: fixed;
        inset: 0 0 auto 0;
        height: 152px;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 52%, var(--secondary) 100%);
        pointer-events: none;
        z-index: -1;
    }

    .container {
        width: 100%;
        max-width: none;
        min-height: 100svh;
        padding: 0 0 max(1rem, env(safe-area-inset-bottom));
    }

    .header {
        position: sticky;
        top: 0;
        z-index: 20;
        margin: 0;
        padding: max(0.85rem, env(safe-area-inset-top)) 1rem 0.9rem;
        text-align: left;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 52%, var(--secondary) 100%);
        box-shadow: 0 10px 22px rgba(26, 26, 46, 0.16);
        animation: none;
    }

    .logo-area {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 0.75rem;
        margin-bottom: 0.2rem;
    }

    .logo-icon {
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.18);
        font-size: 1.45rem;
        animation: none;
    }

    .title {
        min-width: 0;
        font-family: 'Outfit', sans-serif;
        font-size: 1.25rem;
        line-height: 1.15;
        letter-spacing: 0;
        text-shadow: none;
        overflow-wrap: anywhere;
    }

    .subtitle {
        padding-left: 3.55rem;
        font-size: 0.78rem;
        font-weight: 400;
        opacity: 0.86;
    }

    .card {
        margin: 0.85rem 0.75rem;
        border: 1px solid var(--app-border);
        border-radius: 8px;
        box-shadow: 0 8px 24px rgba(26, 26, 46, 0.08);
        animation: none;
    }

    .card:first-of-type {
        margin-top: 1rem;
    }

    .card-header,
    .card-header.admin-header {
        min-height: 52px;
        padding: 0.85rem 1rem;
        background: var(--white);
        border-bottom: 1px solid var(--app-border);
    }

    .card-title {
        font-family: 'Outfit', sans-serif;
        font-size: 0.98rem;
        line-height: 1.25;
        letter-spacing: 0;
        color: var(--dark);
    }

    .badge,
    .badge.admin-badge {
        border-radius: 999px;
        background: rgba(255, 107, 53, 0.1);
        color: var(--primary-dark);
        font-size: 0.73rem;
        padding: 0.35rem 0.65rem;
    }

    .card-body {
        padding: 1rem;
    }

    .form-group {
        margin-bottom: 0.9rem;
    }

    .form-group label {
        margin-bottom: 0.45rem;
        font-size: 0.78rem;
        color: #394150;
    }

    .input-field {
        min-height: 48px;
        padding: 0.85rem 0.95rem;
        border: 1px solid var(--app-border);
        border-radius: 8px;
        background: #F9FAFC;
        font-size: 1rem;
    }

    .input-field:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.12);
    }

    .select-field {
        background-color: #F9FAFC;
        background-position: right 0.95rem center;
    }

    .btn,
    .list-btn {
        min-height: 48px;
        border-radius: 8px;
        font-size: 0.95rem;
        touch-action: manipulation;
    }

    .btn-primary,
    .btn-success {
        width: 100%;
        box-shadow: 0 8px 18px rgba(26, 26, 46, 0.1);
    }

    .btn:hover:not(:disabled),
    .list-btn:hover {
        transform: none;
    }

    .search-filters {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-bottom: 0.75rem;
    }

    .search-box input {
        padding-left: 2.7rem;
    }

    #previewArea,
    #categoriesList,
    .admin-lists {
        scrollbar-width: thin;
    }

    #previewArea {
        min-height: 210px !important;
        max-height: 42svh !important;
        border-width: 1px !important;
        border-radius: 8px !important;
        background: #FBFCFE;
        padding: 0.8rem !important;
    }

    .empty-state {
        min-height: 150px;
        padding: 1rem;
    }

    .empty-icon {
        font-size: 2.35rem;
    }

    .empty-text {
        font-size: 0.92rem;
    }

    .empty-subtext {
        font-size: 0.78rem;
    }

    .card-body > div[style*="display: grid"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem !important;
    }

    .card-body > div[style*="display: grid"] > div {
        border: 1px solid var(--app-border);
        border-radius: 8px !important;
        background: #FBFCFE !important;
        padding: 0.85rem 0.55rem !important;
    }

    .card-body > .form-group > div[style*="display: flex"] {
        flex-direction: column;
        gap: 0.65rem !important;
    }

    .card-body > .form-group > div[style*="display: flex"] .btn {
        width: 100% !important;
        padding: 0.85rem 1rem !important;
    }

    .list-card {
        border: 1px solid var(--app-border);
        border-radius: 8px;
        box-shadow: none;
        animation: none;
    }

    .list-card.has-divergence {
        border-width: 2px;
        box-shadow: 0 8px 20px rgba(239, 71, 111, 0.12);
    }

    .list-card-header {
        align-items: flex-start;
        padding: 0.9rem;
        border-radius: 0;
        gap: 0.75rem;
    }

    .list-card-header > div:first-child {
        min-width: 0;
        flex: 1 1 170px;
    }

    .list-card-header > div:last-child {
        justify-content: flex-start;
        width: 100%;
    }

    .list-card-title {
        font-size: 1rem;
        overflow-wrap: anywhere;
    }

    .list-card-date {
        font-size: 0.76rem;
    }

    .status-badge,
    .divergence-badge {
        border-radius: 999px;
        font-size: 0.68rem;
        line-height: 1.1;
        padding: 0.34rem 0.55rem;
    }

    .list-card-body {
        padding: 0.85rem;
    }

    .list-item {
        align-items: flex-start;
        gap: 0.8rem;
        padding: 0.75rem;
        border: 1px solid var(--app-border);
        border-radius: 8px;
        background: #FBFCFE;
    }

    .list-item-model {
        overflow-wrap: anywhere;
    }

    .list-item-quantity {
        min-width: 42px;
        text-align: right;
    }

    .list-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        padding-top: 0.85rem;
    }

    .list-btn {
        min-width: 0;
        width: 100%;
        padding: 0.72rem 0.5rem;
        white-space: normal;
    }

    input[type="checkbox"] {
        accent-color: var(--danger);
    }

    input,
    select,
    button {
        font: inherit;
    }
}

@media (max-width: 380px) {
    .title {
        font-size: 1.1rem;
    }

    .subtitle {
        padding-left: 0;
    }

    .card {
        margin-left: 0.55rem;
        margin-right: 0.55rem;
    }

    .card-body > div[style*="display: grid"],
    .list-actions {
        grid-template-columns: 1fr !important;
    }
}
