/* admin.css - Modern Minimalistic Green/White Theme */

:root {
    /* Color Palette */
    --primary: #10b981; /* Emerald 500 - Vibrant Green */
    --primary-dark: #047857; /* Emerald 700 */
    --primary-light: #d1fae5; /* Emerald 100 */
    --primary-soft: #ecfdf5; /* Emerald 50 */
    
    --bg-main: #f8fafc; /* Very light slate for body */
    --bg-card: #ffffff; /* Pure white for cards */
    --sidebar-bg: #ffffff;
    
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-color: #e2e8f0;
    
    /* Status Colors */
    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --info: #3b82f6;
    --info-bg: #dbeafe;

    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

/* Typography Utility */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 600;
}
p {
    color: var(--text-muted);
}
.mb-4 { margin-bottom: 24px; }
.mt-3 { margin-top: 16px; }

/* Layout Structure */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* ================== SIDEBAR ================== */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

.sidebar-header {
    padding: 30px 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-dark);
}

.sidebar-header h2 span {
    color: var(--primary);
    font-weight: 400;
}

.nav-links {
    list-style: none;
    padding: 24px 16px;
    flex: 1;
    overflow-y: auto;
}

.nav-links li {
    padding: 14px 18px;
    margin-bottom: 6px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-links li i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.nav-links li:hover {
    background-color: var(--bg-main);
    color: var(--text-dark);
}

.nav-links li.active {
    background-color: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
}

.nav-links li.active i {
    color: var(--primary);
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-btn:hover {
    background-color: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-bg);
}

/* ================== MAIN CONTENT ================== */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    height: 80px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-main);
    padding: 12px 20px;
    border-radius: 30px;
    width: 350px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary-light);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-bar i {
    color: var(--text-light);
    margin-right: 12px;
    font-size: 14px;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: var(--text-dark);
}

.search-bar input::placeholder {
    color: var(--text-light);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 32px;
}

.notification {
    position: relative;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.3rem;
    transition: var(--transition);
}

.notification:hover { color: var(--primary); }

.notification .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: var(--danger);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    border: 2px solid var(--bg-card);
}

.profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px;
    border-radius: 30px;
    transition: var(--transition);
}
.profile:hover {
    background-color: var(--bg-main);
}

.profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.profile-text {
    display: flex;
    flex-direction: column;
}

.profile-text .name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
}
.profile-text .role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Content Area */
.content-wrapper {
    padding: 40px;
}

.content-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 32px;
}

.section-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.section-header p {
    font-size: 15px;
    margin-top: 6px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ================== CARDS & STATS ================== */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card .card-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 10px;
}

.stat-card .card-info h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.stat-card .card-icon {
    width: 50px;
    height: 50px;
    background-color: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 20px;
}

.trend {
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}
.trend.positive { color: var(--success); }
.trend.negative { color: var(--danger); }

/* Dashboard Grid Layouts */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ================== TABLES ================== */
.table-responsive {
    overflow-x: auto;
}

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

.data-table th, .data-table td {
    padding: 16px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: rgba(248, 250, 252, 0.5);
}

.data-table td {
    font-size: 14px;
    vertical-align: middle;
    color: var(--text-dark);
}

.data-table tbody tr {
    transition: var(--transition);
}
.data-table tbody tr:hover {
    background-color: var(--bg-main);
}

.table-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.product-cell, .user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.highlight-text {
    font-weight: 600;
    color: var(--text-dark);
}

/* Badges / Status */
.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status.completed { background-color: var(--success-bg); color: var(--success); }
.status.pending { background-color: var(--warning-bg); color: #b45309; }
.status.processing { background-color: var(--info-bg); color: #1d4ed8; }

/* Table Actions & Filters */
.table-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.table-tools .search-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    width: 250px;
}
.table-tools .search-box input {
    border: none;
    outline: none;
    margin-left: 8px;
    font-size: 14px;
    width: 100%;
}

.table-tools select {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    font-size: 14px;
    background-color: var(--bg-card);
}

/* ================== BUTTONS ================== */
button {
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background-color: var(--bg-main);
    border-color: var(--text-light);
}

.btn-secondary.small, .btn-primary.small {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}
.btn-text:hover { text-decoration: underline; }

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

.action-btn {
    background: var(--bg-main);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover { border-color: var(--border-color); background: var(--bg-card); }
.action-btn.edit:hover { color: var(--info); border-color: var(--info-bg); }
.action-btn.delete:hover { color: var(--danger); border-color: var(--danger-bg); }
.action-btn.view:hover { color: var(--primary); border-color: var(--primary-light); }

/* ================== FORMS ================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    background-color: var(--bg-card);
    color: var(--text-dark);
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-row {
    display: flex;
    gap: 20px;
}
.form-row .form-group {
    flex: 1;
}

/* File Upload Box */
.file-upload-box {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    background-color: var(--bg-main);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}
.file-upload-box:hover {
    border-color: var(--primary);
    background-color: var(--primary-soft);
}
.file-upload-box i {
    font-size: 32px;
    color: var(--text-light);
    margin-bottom: 12px;
}
.file-upload-box p {
    font-size: 14px;
    font-weight: 500;
}
.hidden-file-input {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}

/* Color Picker Custom */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}
.color-picker {
    -webkit-appearance: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
}
.color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker::-webkit-color-swatch { border: none; border-radius: 8px; }
.color-hex { font-family: monospace; font-size: 14px; background: var(--bg-main); padding: 8px 12px; border-radius: 6px; border: 1px solid var(--border-color); }

/* ================== MODALS ================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

@keyframes modalPop {
    from { transform: scale(0.95) translateY(-20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 { font-size: 20px; }

.close-modal {
    font-size: 28px;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}
.close-modal:hover { color: var(--danger); }

.modal-body {
    padding: 32px;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: var(--bg-main);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ================== MESSAGES ================== */
.messages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.message-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-light);
}

.message-card.unread {
    border-left: 4px solid var(--primary);
    background-color: rgba(16, 185, 129, 0.02);
}

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

.msg-sender {
    display: flex;
    align-items: center;
    gap: 10px;
}
.msg-sender h4 { font-size: 15px; }
.msg-time { font-size: 12px; color: var(--text-light); }

.message-card h4 { font-size: 16px; margin-bottom: 8px; color: var(--text-dark); }
.message-card p { font-size: 14px; line-height: 1.6; margin-bottom: 16px; }

.msg-actions {
    display: flex;
    gap: 10px;
}

/* ================== ANALYTICS / SOCIAL ================== */
.social-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.social-stat-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.social-stat-item:hover {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.social-stat-item .icon-box {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    margin-right: 16px;
}

.social-stat-item.instagram .icon-box { background: rgba(225, 48, 108, 0.1); color: #E1306C; }
.social-stat-item.facebook .icon-box { background: rgba(24, 119, 242, 0.1); color: #1877F2; }
.social-stat-item.tiktok .icon-box { background: rgba(0, 0, 0, 0.05); color: #000000; }

.stat-content { flex: 1; }
.stat-content h4 { font-size: 15px; margin-bottom: 4px; }
.stat-content p { font-size: 13px; color: var(--text-muted); }

.stat-trend {
    font-weight: 600;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--success-bg);
    color: var(--success);
}

/* ================== SETTINGS ================== */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 800px;
    gap: 24px;
}
.settings-title {
    font-size: 18px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
    .topbar { padding: 0 20px; }
    .content-wrapper { padding: 20px; }
    .stat-cards { grid-template-columns: 1fr; }
}
