/* ===== ADMIN PAGE STYLES ===== */

.admin-page {
    background: #f4f7f9;
    min-height: 100vh;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-container {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.login-form input {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 16px;
    text-align: center;
    outline: none;
}

.login-form input:focus {
    border-color: var(--primary);
}

.login-form button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.login-form button:hover {
    background: var(--primary-dark);
}

.back-to-menu {
    margin-top: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

/* Dashboard Layout */
.admin-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    overflow: hidden;
}

.admin-sidebar {
    background: #11111d; /* Darker, more premium color */
    color: white;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.sidebar-logo {
    font-size: 24px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    padding: 14px 16px;
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
}

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

.nav-item.active {
    background: var(--primary);
    color: white;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

#logout-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

/* Content Area */
.admin-content {
    padding: 30px;
    background: #f0f2f5;
    overflow-y: auto;
    width: 100%;
    scrollbar-width: thin;
}

.prod-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.product-row td {
    vertical-align: middle;
}

.category-tag {
    background: #e0f2fe;
    color: #0369a1;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

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

.content-header h1 {
    font-size: 28px;
    font-weight: 800;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary {
    background: #eee;
    color: var(--text-primary);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

/* Card Table */
.card-table {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

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

th {
    background: #f9fafb;
    padding: 16px;
    text-align: left;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid #eee;
}

td {
    padding: 16px;
    border-bottom: 1px solid #f9fafb;
    font-size: 15px;
}

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

.btn-delete {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.settings-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.settings-card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

/* Modal Mini Overlay Fix */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-mini {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-mini {
    transform: translateY(0);
}

/* ===== OPTIONS BUILDER ADMIN ===== */
.options-admin-section {
    background: #fcfcfc;
    border: 1px dashed #ddd;
    border-radius: 12px;
    padding: 15px;
}

.option-group-admin {
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.option-group-admin:last-child {
    margin-bottom: 0;
}

.btn-remove-group {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
}

.option-items-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-item-admin {
    display: flex;
    gap: 8px;
    align-items: center;
}

.option-item-admin input {
    font-size: 13px;
    padding: 8px 10px;
}

.btn-remove-item {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 18px;
    padding: 0 5px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-ghost-primary {
    background: #eff6ff;
    color: #3b82f6;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-ghost-primary:hover {
    background: #dbeafe;
}

/* Toast for Admin */
.toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    z-index: 3000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.toast.show {
    bottom: 30px;
    opacity: 1;
}

/* Responsive */
@media (max-width: 1100px) {
    .admin-wrapper {
        grid-template-columns: 80px 1fr;
    }
    .sidebar-logo { margin: 0 auto; }
    .sidebar-nav button span { display: none; }
    .sidebar-header h3, .sidebar-footer button, .profile-store-name { display: none; }
    .nav-item { text-align: center; padding: 14px 0; }
}

@media (max-width: 768px) {
    .admin-wrapper {
        grid-template-columns: 0 1fr;
    }
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        transition: left 0.3s ease;
    }
    .admin-sidebar.active {
        left: 0;
    }
    /* Mobile header would be needed here */
}

/* ===== DASHBOARD PREMIUM STYLES ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 24px;
    border-radius: 20px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.stat-card:hover { transform: translateY(-5px); }

.stat-card h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    opacity: 0.85;
}

.stat-card h2 {
    font-size: 28px;
    font-weight: 800;
}

.stat-card i {
    position: absolute;
    right: -20px;
    bottom: -20px;
    font-size: 120px;
    opacity: 0.1;
}

.kanban-container {
    width: 100%;
    margin-top: 10px;
}

.kanban-board-wrapper {
    display: flex;
    gap: 15px; /* Reduced gap */
    padding-bottom: 20px;
    width: 100%;
}

.kanban-column {
    flex: 1;
    min-width: 0;
    max-width: 20%;
    background: #f8fafc;
    border-radius: 16px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    border: 1px solid #eef2f6;
    height: calc(100vh - 280px); /* Fixed height based on viewport */
}

/* Custom internal scroll container for cards */
.kanban-cards-area {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-cards-area::-webkit-scrollbar { width: 4px; }
.kanban-cards-area::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.kanban-column-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #334155;
}

.column-count {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.kanban-card {
    background: white;
    padding: 18px;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid #f1f5f9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.kanban-card:hover {
    box-shadow: 0 10px 15px rgba(0,0,0,0.05);
}

.order-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: #f1f5f9;
}

/* History Table Styles */
.history-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.history-table th {
    background: #f8fafc;
    padding: 15px;
    text-align: left;
    font-weight: 700;
    color: #64748b;
    border-bottom: 2px solid #edf2f7;
}

.history-table td {
    padding: 15px;
    border-bottom: 1px solid #edf2f7;
    color: #1e293b;
}

.history-table tr:hover { background: #f1f5f9; }

.status-tag {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-tag.concluido { background: #dcfce7; color: #166534; }
.status-tag.cancelado { background: #fee2e2; color: #991b1b; }
.status-tag.arquivado { background: #f1f5f9; color: #475569; }

/* Status Toggle Switch */
.status-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
}

.status-label {
    font-size: 14px;
    font-weight: 700;
}

.status-label.open { color: #10b981; }
.status-label.closed { color: #ef4444; }

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ef4444; /* Default closed (red) */
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #10b981; /* Open (green) */
}

input:focus + .slider {
    box-shadow: 0 0 1px #10b981;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Hours Grid */
.hours-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hour-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr 100px;
    align-items: center;
    gap: 20px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #edf2f7;
}

.hour-day {
    font-weight: 700;
    color: #334155;
    font-size: 14px;
}

.hour-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hour-input-group label {
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
}

.hour-row input[type="time"] {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-family: inherit;
    font-size: 14px;
}

.hour-closed-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hour-closed-toggle label {
    font-size: 11px;
    color: #64748b;
    font-weight: 700;
}

.hour-row.is-closed {
    opacity: 0.6;
    background: #f1f5f9;
}

.hour-row.is-closed input[type="time"] {
    background: #e2e8f0;
    pointer-events: none;
}

@media (max-width: 600px) {
    .hour-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .hour-day {
        grid-column: span 2;
    }
}

