/* --- ADMIN PREMIUM UI THEME --- */

/* Root Variables for Admin Theme */
:root {
    --admin-primary: #2c3e50;
    --admin-accent: #3498db;
    --admin-success: #27ae60;
    --admin-danger: #c0392b;
    --admin-bg-light: #f8f9fa;
    --admin-card-bg: #ffffff;
    --admin-border-radius: 12px;
    --admin-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    --admin-shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* --- TABS NAVIGATION --- */
.admin-tabs {
    display: flex;
    gap: 1rem;
    padding-bottom: 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e9ecef;
}

.admin-tab {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
}

.admin-tab:hover {
    color: var(--admin-primary);
    background: rgba(0, 0, 0, 0.02);
}

.admin-tab.active {
    color: var(--admin-accent);
    border-bottom-color: var(--admin-accent);
    background: white;
}

/* --- ACTION TOOLBAR --- */
.admin-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    background: white;
    padding: 1rem;
    border-radius: var(--admin-border-radius);
    box-shadow: var(--admin-shadow);
}

.search-box input {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    width: 300px;
    transition: border-color 0.3s;
    outline: none;
}

.search-box input:focus {
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* --- BUTTONS --- */
.btn-add,
.btn-save,
.btn-edit,
.btn-delete {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-add {
    background: linear-gradient(135deg, var(--admin-accent), #2980b9);
    color: white;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.3);
}

.btn-edit {
    background: #f1f2f6;
    color: var(--admin-primary);
}

.btn-edit:hover {
    background: #e2e6ea;
}

.btn-delete {
    background: #fee2e2;
    color: var(--admin-danger);
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
}

.btn-delete:hover {
    background: #fecaca;
}

.btn-cancel {
    background: #e5e7eb;
    color: #374151;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #d1d5db;
    color: #111827;
}

/* --- CARD GRID --- */
.admin-grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.admin-card {
    background: white;
    border-radius: var(--admin-border-radius);
    box-shadow: var(--admin-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    flex-direction: column;
}

.admin-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--admin-shadow-hover);
}

.card-header-mini {
    padding: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-bottom: 1px solid #ecf0f1;
}

.card-body {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-body h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.card-body p {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.9rem;
    line-height: 1.5;
}

.card-body .actions {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* --- BADGES --- */
.badge-cat,
.badge-order {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-cat {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-order {
    background: #f5f5f5;
    color: #666;
}

/* --- JSON EDITOR (Phones/Emails) --- */
.json-list {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.json-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.json-row input {
    flex: 1;
    padding: 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-del-mini {
    background: #ffecb3;
    border: none;
    color: #f57c00;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    width: 24px;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .admin-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .search-box input {
        width: 100%;
    }

    .admin-grid-list {
        grid-template-columns: 1fr;
    }
}

/* --- FORMS (MODALS) --- */
.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #444;
    font-size: 0.9rem;
}

/* Updated Input/Select/Textarea styling to match premium aesthetic */
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="color"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    /* Lighter border */
    border-radius: 8px;
    /* Softer corners */
    font-size: 0.95rem;
    color: #374151;
    /* Dark text */
    background-color: #f9fafb;
    /* Very light background */
    transition: all 0.2s ease-in-out;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--admin-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    /* Focus ring */
    background-color: #ffffff;
}

/* Two-column layout in forms */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Form actions footer (sticky or just bottom) */
.form-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
}

.form-actions button {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    /* Larger touch targets */
}

/* ===== TOGGLE SWITCH (Admin Módulos) ===== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: #10b981;
}

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

.toggle-switch input:disabled+.toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}