/* ============================================
   SISTEMA DE ÓRDENES - ESTILO MODERNO
   Completamente diferente a kbellos.com.co
   ============================================ */

:root {
    --primary: #6C5CE7;
    --primary-dark: #5A4BD1;
    --primary-light: #A29BFE;
    --secondary: #00CEC9;
    --accent: #FD79A8;
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #E17055;
    --dark: #2D3436;
    --gray-900: #1a1a2e;
    --gray-800: #16213e;
    --gray-700: #0f3460;
    --gray-600: #533483;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-400: #CED4DA;
    --gray-500: #ADB5BD;
    --white: #FFFFFF;
    --shadow: 0 10px 40px rgba(0,0,0,0.15);
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 50%, var(--gray-700) 100%);
    color: var(--gray-100);
    min-height: 100vh;
    line-height: 1.6;
}

/* ========================================
   AUTH PAGES (Login / Register)
   ======================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(0, 206, 201, 0.06) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(1deg); }
    66% { transform: translate(-20px, 20px) rotate(-1deg); }
}

.auth-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    box-shadow: var(--shadow);
}

.auth-card .logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-card .logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    box-shadow: 0 8px 32px rgba(108, 92, 231, 0.3);
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: var(--white);
    margin-bottom: 4px;
}

.auth-card p.subtitle {
    text-align: center;
    color: var(--gray-400);
    font-size: 14px;
    margin-bottom: 32px;
}

.auth-card .form-group {
    margin-bottom: 20px;
}

.auth-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-300);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.auth-card .input-wrapper {
    position: relative;
}

.auth-card .input-wrapper .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    font-size: 18px;
    pointer-events: none;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="tel"] {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 15px;
    transition: var(--transition);
    outline: none;
}

.auth-card input:focus {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.08);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.15);
}

.auth-card input::placeholder {
    color: var(--gray-500);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    width: 100%;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(108, 92, 231, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #c0392b);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    width: auto;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 18px;
}

.auth-card .auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-card .auth-footer a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-card .auth-footer a:hover {
    color: var(--secondary);
}

.error-msg {
    background: rgba(225, 112, 85, 0.12);
    border: 1px solid rgba(225, 112, 85, 0.25);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
    display: none;
}

.success-msg {
    background: rgba(0, 184, 148, 0.12);
    border: 1px solid rgba(0, 184, 148, 0.25);
    color: var(--success);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
    display: none;
}

/* ========================================
   DASHBOARD
   ======================================== */

.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar .logo-small {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    text-decoration: none;
}

.sidebar .logo-small .icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sidebar .logo-small span {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
}

.sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 4px;
}

.sidebar .nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
}

.sidebar .nav-item.active {
    background: rgba(108, 92, 231, 0.15);
    color: var(--primary-light);
}

.sidebar .nav-item .badge {
    margin-left: auto;
    background: rgba(108, 92, 231, 0.2);
    color: var(--primary-light);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.sidebar .user-info {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar .user-info .name {
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
}

.sidebar .user-info .email {
    font-size: 12px;
    color: var(--gray-500);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
}

.main-content .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.main-content .page-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
}

.main-content .page-header p {
    color: var(--gray-400);
    font-size: 14px;
    margin-top: 4px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.stat-card .stat-icon.purple { background: rgba(108, 92, 231, 0.15); color: var(--primary-light); }
.stat-card .stat-icon.green { background: rgba(0, 184, 148, 0.15); color: var(--success); }
.stat-card .stat-icon.orange { background: rgba(253, 203, 110, 0.15); color: var(--warning); }
.stat-card .stat-icon.red { background: rgba(225, 112, 85, 0.15); color: var(--danger); }
.stat-card .stat-icon.blue { background: rgba(0, 206, 201, 0.15); color: var(--secondary); }

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 2px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-400);
}

/* Import Bar */
.import-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: rgba(108, 92, 231, 0.08);
    border: 1px solid rgba(108, 92, 231, 0.15);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}

.import-bar .import-bar-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
}

.import-bar .import-bar-icon {
    font-size: 20px;
}

.import-bar .import-bar-actions {
    display: flex;
    gap: 8px;
}

/* Upload Zone */
.upload-zone {
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 32px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.05);
}

.upload-zone .upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--gray-400);
}

.upload-zone h3 {
    font-size: 18px;
    color: var(--white);
    margin-bottom: 8px;
}

.upload-zone p {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 20px;
}

.upload-zone .file-info {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 12px;
}

.upload-zone input[type="file"] {
    display: none;
}

/* Progress Bar */
.progress-container {
    display: none;
    margin-bottom: 32px;
}

.progress-container .progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--gray-300);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar select,
.filter-bar input {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.filter-bar select:focus,
.filter-bar input:focus {
    border-color: var(--primary);
}

.filter-bar select option {
    background: var(--gray-800);
    color: var(--white);
}

.filter-bar select {
    min-width: 200px;
    cursor: pointer;
}

.filter-bar input {
    min-width: 160px;
}

.filter-bar input::placeholder {
    color: var(--gray-500);
}

/* Tables */
.table-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    overflow: hidden;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition);
}

table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

table tbody td {
    padding: 12px 20px;
    font-size: 14px;
    color: var(--gray-200);
}

table tbody td .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.generated {
    background: rgba(0, 206, 201, 0.12);
    color: var(--secondary);
}

.status-badge.delivered {
    background: rgba(0, 184, 148, 0.12);
    color: var(--success);
}

.status-badge.cancelled {
    background: rgba(225, 112, 85, 0.12);
    color: var(--danger);
}

.status-badge.pending {
    background: rgba(253, 203, 110, 0.12);
    color: var(--warning);
}

.action-btns {
    display: flex;
    gap: 8px;
}

.action-btns .btn-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
}

.btn-whatsapp:hover {
    background: rgba(37, 211, 102, 0.25);
    transform: scale(1.1);
}

.btn-call {
    background: rgba(0, 206, 201, 0.15);
    color: var(--secondary);
}

.btn-call:hover {
    background: rgba(0, 206, 201, 0.25);
    transform: scale(1.1);
}

/* Tienda Card */
.tienda-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    transition: var(--transition);
    cursor: pointer;
}

.tienda-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.tienda-card .tienda-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tienda-card .tienda-id {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
}

.tienda-card .tienda-count {
    display: flex;
    gap: 8px;
}

.tienda-card .count-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.tienda-card .tienda-actions {
    display: flex;
    gap: 8px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 64px 20px;
}

.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--white);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
    box-shadow: var(--shadow);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: linear-gradient(135deg, var(--success), #00a381);
}

.toast.error {
    background: linear-gradient(135deg, var(--danger), #c0392b);
}

.toast.info {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--gray-800);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--white);
}

.modal-content .close-btn {
    float: right;
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 24px;
    cursor: pointer;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: fixed;
        bottom: 0;
        z-index: 100;
        flex-direction: row;
        padding: 12px 16px;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        overflow-x: auto;
    }

    .sidebar .logo-small,
    .sidebar .user-info {
        display: none;
    }

    .sidebar .nav {
        display: flex;
        gap: 4px;
    }

    .sidebar .nav-item {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .main-content {
        padding: 20px 16px;
        padding-bottom: 80px;
    }

    .main-content .page-header h2 {
        font-size: 22px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .upload-zone {
        padding: 24px;
    }

    .auth-card {
        padding: 32px 24px;
    }
}
