/* ============================================ */
/* DONA MOTTA - Admin Styles */
/* ============================================ */

:root {
    --primary: #0A3D2D;
    --primary-dark: #073328;
    --accent: #D4AF37;
    --bg-cream: #FDFBF7;
    --bg-light: #F5F2ED;
    --bg-dark: #1A1A1A;
    --text-main: #1A1A1A;
    --text-muted: #666;
    --text-light: #999;
    --white: #FFFFFF;
    --error: #E74C3C;
    --success: #27AE60;
    --warning: #F39C12;
    --info: #3498DB;
    --border: #E5E5E5;
    --transition: all 0.3s ease;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

/* --- Toast --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
}

.toast {
    background: var(--white);
    padding: 15px 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    min-width: 300px;
    border-left: 4px solid var(--primary);
    margin-bottom: 10px;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- Login Screen --- */
.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-card {
    background: var(--white);
    padding: 50px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo h1 {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 5px;
}

.login-logo span {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 12px;
}

.login-card form {
    margin-top: 40px;
}

.login-card .form-group {
    text-align: left;
    margin-bottom: 20px;
}

.login-card label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
}

.login-card input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.login-card input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 61, 45, 0.1);
}

.login-hint {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-light);
}

/* --- Dashboard Layout --- */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.admin-sidebar {
    width: 260px;
    background: var(--primary);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 30px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 24px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-header span {
    font-size: 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-left: 3px solid var(--accent);
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

/* --- Main Content --- */
.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 0;
}

/* --- Header --- */
.admin-header {
    background: var(--white);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-light);
    padding: 12px 20px;
    border-radius: 50px;
    width: 400px;
}

.header-search input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: 14px;
}

.header-search input:focus {
    outline: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}

.notification-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error);
    color: var(--white);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.admin-user span {
    font-size: 14px;
    font-weight: 500;
}

/* --- Sections --- */
.admin-section {
    padding: 40px;
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h1 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 5px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-card.large {
    flex-direction: column;
    text-align: center;
    padding: 30px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
}

.stat-info {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-card.large .stat-value {
    font-size: 36px;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.stat-change {
    display: block;
    font-size: 13px;
    margin-top: 8px;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--error); }

/* --- Filters --- */
.section-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.filter-group input,
.filter-group select {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 150px;
}

/* --- Table --- */
.table-container {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    overflow-x: auto;
    box-shadow: var(--shadow);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.admin-table td {
    font-size: 14px;
}

.admin-table tr:hover {
    background: var(--bg-cream);
}

.admin-table img {
    width: 50px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

/* --- Status Badge --- */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.new { background: #E8F8F5; color: var(--success); }
.status-badge.sale { background: #FDF2E9; color: var(--warning); }
.status-badge.normal { background: var(--bg-light); color: var(--text-muted); }
.status-badge.processing { background: #EBF5FB; color: var(--info); }
.status-badge.shipped { background: #FEF9E7; color: var(--warning); }
.status-badge.delivered { background: #E8F8F5; color: var(--success); }

/* --- Action Buttons --- */
.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.table-actions .edit-btn {
    background: var(--info);
    color: var(--white);
}

.table-actions .delete-btn {
    background: var(--error);
    color: var(--white);
}

.table-actions button:hover {
    opacity: 0.8;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 61, 45, 0.1);
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.form-column {
    padding-right: 20px;
    border-right: 1px solid var(--border);
}

.form-column:last-child {
    border-right: none;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    color: var(--primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-content form {
    padding: 30px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border);
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-muted);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
}

/* --- Config Groups --- */
.config-groups {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
}

.config-group {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.config-group:last-of-type {
    border-bottom: none;
    margin-bottom: 30px;
}

.config-group h3 {
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 20px;
}

/* --- Coupons Grid --- */
.coupons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.coupon-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.coupon-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--accent);
}

.coupon-card h4 {
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 10px;
}

.coupon-card .discount {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
}

.coupon-card .details {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.coupon-card .actions {
    display: flex;
    gap: 10px;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .coupons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 80px;
    }
    .sidebar-header h2,
    .sidebar-header span,
    .sidebar-nav a span {
        display: none;
    }
    .sidebar-nav a {
        justify-content: center;
        padding: 15px;
    }
    .admin-main {
        margin-left: 80px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-column {
        border-right: none;
        padding-right: 0;
        margin-bottom: 20px;
    }
    .header-search {
        display: none;
    }
}
