/* Admin Panel Styles - THAI OTR SUPPLIERS */

:root {
    --primary-color: #F97316;
    --primary-dark: #EA580C;
    --primary-light: #FB923C;
    --secondary-color: #1976d2;
    --danger-color: #d32f2f;
    --warning-color: #F97316;
    --success-color: #22c55e;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --sidebar-width: 260px;
    --header-height: 70px;
    --dark-bg: #0A0A0A;
    --dark-hover: #1A1A1A;
    --navbar-height: 60px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f5f7fa;
}

.login-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
}

.login-box {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.login-icon {
    text-align: center;
    margin-bottom: 24px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background: #ffffff;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.error-message {
    background: #fee;
    color: var(--danger-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.success-message {
    background: #e8f5e9;
    color: var(--success-color);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: #1e3a8a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
}

.login-footer a {
    color: #1e3a8a;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: #1e40af;
    text-decoration: underline;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #1a2332;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header .admin-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 6px;
}

.sidebar-header h2 {
    font-size: 17px;
    color: #ffffff;
    font-weight: 600;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.nav-item {
    padding: 11px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: #ffffff;
    border-left-color: rgba(255,255,255,0.2);
}

.nav-item.active {
    background: rgba(46, 125, 50, 0.25);
    color: #4caf50;
    border-left-color: #4caf50;
    font-weight: 500;
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* Sidebar User Area */
.sidebar-user {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.3);
    color: #4caf50;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
}

.sidebar-user .user-email {
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    padding: 8px 24px 24px;
}

.sidebar-logout .btn-logout-sidebar {
    width: 100%;
    padding: 10px;
    background: rgba(211, 47, 47, 0.2);
    color: #ef5350;
    border: 1px solid rgba(211, 47, 47, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-logout .btn-logout-sidebar:hover {
    background: rgba(211, 47, 47, 0.35);
    color: #ff6b6b;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
}

.top-header {
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.top-header h1 {
    font-size: 24px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-logout {
    padding: 8px 20px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #b71c1c;
}

.content-area {
    padding: 30px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--card-bg);
    padding: 20px 24px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-card .stat-info h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .stat-icon {
    font-size: 40px;
    opacity: 0.2;
}

/* Tables */
.data-table {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.table-header h2 {
    font-size: 18px;
}

.table-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.btn-primary {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.btn-back:hover {
    text-decoration: underline;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-color);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

td {
    font-size: 14px;
}

tr:hover {
    background: var(--bg-color);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-live {
    background: #e8f5e9;
    color: var(--success-color);
}

.status-live::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    display: inline-block;
}

.status-draft {
    background: #f5f5f5;
    color: var(--text-secondary);
}

.status-draft::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    display: inline-block;
}

.status-new {
    background: #fff3e0;
    color: var(--warning-color);
}

.status-read {
    background: #e3f2fd;
    color: var(--secondary-color);
}

.status-replied {
    background: #e8f5e9;
    color: var(--success-color);
}

/* Product Summary Cards */
.product-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* Dashboard Sections */
.dashboard-section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-link {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.section-link:hover {
    text-decoration: underline;
}

.summary-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.2s;
}

.summary-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.summary-card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.summary-card .card-icon.blue { background: #e3f2fd; }
.summary-card .card-icon.green { background: #e8f5e9; }
.summary-card .card-icon.amber { background: #fff8e1; }
.summary-card .card-icon.purple { background: #f3e5f5; }

.summary-card .card-info h3 {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 500;
}

.summary-card .card-info .card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.summary-card.card-link {
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
}

.summary-card.card-link:hover {
    border-color: var(--primary-color);
}

.summary-card .card-link-text {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 14px;
}

/* Action Icons */
.action-icons {
    display: flex;
    gap: 6px;
}

.action-icons .icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: transparent;
    font-size: 15px;
    color: var(--text-secondary);
    text-decoration: none;
}

.action-icons .icon-btn:hover {
    background: var(--bg-color);
}

.action-icons .icon-btn.edit:hover {
    color: var(--secondary-color);
    background: #e3f2fd;
}

.action-icons .icon-btn.view:hover {
    color: var(--primary-color);
    background: #e8f5e9;
}

.action-icons .icon-btn.delete:hover {
    color: var(--danger-color);
    background: #ffebee;
}

/* Product Cell */
.product-cell {
    display: flex;
    flex-direction: column;
}

.product-cell .product-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.product-cell .product-id {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-edit {
    background: #e3f2fd;
    color: var(--secondary-color);
}

.btn-edit:hover {
    background: var(--secondary-color);
    color: white;
}

.btn-delete {
    background: #ffebee;
    color: var(--danger-color);
}

.btn-delete:hover {
    background: var(--danger-color);
    color: white;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* Product Edit Form */
.product-form {
    max-width: 900px;
}

.form-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.form-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.spec-row {
    margin-bottom: 10px;
    align-items: center;
}

.spec-row input {
    flex: 1;
}

.seo-section {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.seo-section legend {
    font-weight: 600;
    font-size: 14px;
    padding: 0 8px;
    color: var(--text-secondary);
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.detail-table td:first-child {
    width: 180px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500 !important;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .product-summary-cards {
        grid-template-columns: 1fr 1fr;
    }
}

/* Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 20px;
}

.media-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.media-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.media-preview {
    width: 100%;
    height: 140px;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-file-icon {
    font-size: 48px;
    opacity: 0.4;
}

.media-info {
    padding: 12px;
}

.media-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.media-date {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ===== MODERN ADMIN UI UPGRADE ===== */

/* Adjust dashboard layout for new top navbar */
.dashboard {
    padding-top: var(--navbar-height);
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Top Admin Navbar */
.admin-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--navbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 99;
    box-shadow: var(--shadow-sm);
    gap: 16px;
}

.admin-header .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.admin-header .header-left .site-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.admin-header .header-left .site-title span {
    color: var(--primary-color);
}

/* Hamburger for mobile */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 6px;
}

.sidebar-toggle:hover {
    background: var(--bg-color);
}

/* Search Box */
.header-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 8px 16px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    background: var(--bg-color);
    transition: all 0.2s;
    outline: none;
}

.header-search input:focus {
    border-color: var(--primary-color);
    background: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}

.header-search::before {
    content: '🔍';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    opacity: 0.4;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    position: relative;
    transition: all 0.2s;
}

.header-action-btn:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

/* Notification Bell */
.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: var(--danger-color);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--card-bg);
}

/* Quick Actions Button */
.btn-quick-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-quick-actions:hover {
    background: var(--primary-dark);
}

/* Profile Button in Header */
.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-btn:hover {
    background: var(--bg-color);
}

.profile-btn .profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.profile-btn .profile-info {
    text-align: left;
}

.profile-btn .profile-info .p-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.profile-btn .profile-info .p-email {
    font-size: 11px;
    color: var(--text-secondary);
}

.profile-btn .p-arrow {
    font-size: 10px;
    color: var(--text-secondary);
    margin-left: 4px;
}

/* Dropdown Styles */
.dropdown-wrapper {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 6px;
    display: none;
    z-index: 1000;
    animation: dropFade 0.15s ease;
}

.dropdown-menu.show {
    display: block;
}

@keyframes dropFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu .dropdown-header {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-menu .dropdown-item:hover {
    background: var(--bg-color);
}

.dropdown-menu .dropdown-item.danger {
    color: var(--danger-color);
}

.dropdown-menu .dropdown-item.danger:hover {
    background: #ffebee;
}

.dropdown-menu .dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* Notifications Dropdown */
.notif-dropdown {
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.notif-dropdown .notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: var(--text-primary);
}

.notif-dropdown .notif-item:hover {
    background: var(--bg-color);
}

.notif-dropdown .notif-item.unread {
    background: #f0fdf4;
}

.notif-dropdown .notif-item.unread:hover {
    background: #dcfce7;
}

.notif-dropdown .notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.notif-dropdown .notif-content {
    flex: 1;
    min-width: 0;
}

.notif-dropdown .notif-content .notif-msg {
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 2px;
}

.notif-dropdown .notif-content .notif-time {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Quick Actions Dropdown */
.quick-actions-dropdown {
    min-width: 200px;
}

.quick-actions-dropdown .dropdown-item .qa-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.quick-actions-dropdown .dropdown-item .qa-icon.green { background: #e8f5e9; }
.quick-actions-dropdown .dropdown-item .qa-icon.blue { background: #e3f2fd; }
.quick-actions-dropdown .dropdown-item .qa-icon.purple { background: #f3e5f5; }
.quick-actions-dropdown .dropdown-item .qa-icon.amber { background: #fff8e1; }

/* Dashboard Stats Grid */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.dashboard-stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.dashboard-stat-card .ds-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.dashboard-stat-card .ds-icon.green { background: #e8f5e9; color: var(--success-color); }
.dashboard-stat-card .ds-icon.blue { background: #e3f2fd; color: var(--secondary-color); }
.dashboard-stat-card .ds-icon.purple { background: #f3e5f5; color: #7b1fa2; }
.dashboard-stat-card .ds-icon.amber { background: #fff8e1; color: var(--warning-color); }
.dashboard-stat-card .ds-icon.red { background: #ffebee; color: var(--danger-color); }
.dashboard-stat-card .ds-icon.teal { background: #e0f2f1; color: #00796b; }

.dashboard-stat-card .ds-info { flex: 1; }
.dashboard-stat-card .ds-info .ds-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; margin-bottom: 4px; }
.dashboard-stat-card .ds-info .ds-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.dashboard-stat-card .ds-info .ds-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* System Health Panel */
.health-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.health-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.health-card .health-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.health-card .health-header .health-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.health-card .health-header .health-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.health-indicator.green { background: var(--success-color); box-shadow: 0 0 6px rgba(56,142,60,0.4); }
.health-indicator.yellow { background: var(--warning-color); box-shadow: 0 0 6px rgba(245,124,0,0.4); }
.health-indicator.red { background: var(--danger-color); box-shadow: 0 0 6px rgba(211,47,47,0.4); }

.health-card .health-value {
    font-size: 13px;
    color: var(--text-secondary);
}

.health-card .health-value strong {
    color: var(--text-primary);
}

/* Clickable Cards */
.clickable-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.clickable-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.clickable-card:active::after {
    width: 300px;
    height: 300px;
}

.clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.clickable-card:active {
    transform: translateY(0);
}

/* Admin Users Table */
.user-role-badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.user-role-badge.super-admin { background: #f3e5f5; color: #7b1fa2; }
.user-role-badge.admin { background: #e3f2fd; color: var(--secondary-color); }
.user-role-badge.editor { background: #e8f5e9; color: var(--success-color); }

.user-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.user-status-dot.active { background: var(--success-color); }
.user-status-dot.inactive { background: var(--text-secondary); }

/* Sidebar Additional Items */
.sidebar-nav .nav-section-label {
    padding: 16px 24px 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .health-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 200;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .admin-header {
        left: 0;
    }
    .sidebar-toggle {
        display: flex;
    }
    .header-search {
        display: none;
    }
    .admin-header .header-left .site-title {
        font-size: 14px;
    }
    .profile-btn .profile-info {
        display: none;
    }
    .btn-quick-actions span {
        display: none;
    }
    .dashboard-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .health-grid {
        grid-template-columns: 1fr 1fr;
    }
    .notif-dropdown {
        min-width: 280px;
    }
}

@media (max-width: 480px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
    .health-grid {
        grid-template-columns: 1fr;
    }
    .admin-header {
        padding: 0 12px;
    }
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 150;
}

.sidebar-overlay.show {
    display: block;
}

@media (min-width: 769px) {
    .sidebar-overlay.show {
        display: none;
    }
}

/* ===== SEO MANAGER STYLES ===== */

/* Alert Messages */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}
.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}
.alert-error {
    background: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
}

/* Tab Navigation */
.seo-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}
.seo-tab {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none !important;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
}
.seo-tab:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}
.seo-tab.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(46,125,50,0.3);
}

/* SEO Card */
.seo-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}
.seo-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.seo-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Mini Stats Grid */
.mini-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.mini-stat {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}
.mini-stat .num {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}
.mini-stat .label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Analysis Cards */
.analysis-card {
    background: var(--bg-color);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.analysis-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--card-bg);
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 13px;
}
.analysis-item span:first-child {
    color: var(--text-primary);
    word-break: break-all;
    margin-right: 12px;
}

/* Badges */
.badge-fail {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #ffebee;
    color: #c62828;
    flex-shrink: 0;
}
.badge-warn {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #fff8e1;
    color: #f57f17;
    flex-shrink: 0;
}
.badge-pass {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #e8f5e9;
    color: #2e7d32;
    flex-shrink: 0;
}
.badge-custom {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #e3f2fd;
    color: #1565c0;
}

/* Social Media Preview */
.social-preview {
    max-width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg);
    margin-bottom: 12px;
}
.social-preview img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--bg-color);
    display: block;
}
.social-preview-body {
    padding: 14px 16px;
}
.social-preview-body .sp-domain {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.social-preview-body .sp-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a0dab;
    line-height: 1.3;
    margin-bottom: 4px;
}
.social-preview-body .sp-desc {
    font-size: 14px;
    color: #545454;
    line-height: 1.4;
}

/* Toggle Switches */
.toggle-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-color);
    border-radius: 10px;
    margin-bottom: 10px;
}
.toggle-label {
    flex: 1;
}
.toggle-label strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}
.toggle-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.toggle-wrap .checkbox-label {
    margin-left: 16px;
}

/* Checklist */
.checklist {
    list-style: none;
    padding: 0;
}
.checklist li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}
.check-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}
.check-detail {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Code/Schema Editors */
.code-editor, .schema-editor {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 13px;
    line-height: 1.5;
    background: #1a2332 !important;
    color: #e8e8e8 !important;
    border: 1px solid #2d3a4a !important;
    border-radius: 8px;
    padding: 14px 16px !important;
    width: 100%;
    min-height: 120px;
    tab-size: 2;
}

/* Utility Classes */
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
}
.inline-form .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}
.highlight-row {
    background: #f0fdf4 !important;
}

/* Page Subtitle */
.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* SEO Score Bar */
.seo-score-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}
.seo-score-fill {
    height: 8px;
    border-radius: 4px;
    flex: 1;
    max-width: 80px;
    background: var(--border-color);
    overflow: hidden;
}
.seo-score-fill-inner {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.seo-score-fill-inner.good { background: var(--success-color); }
.seo-score-fill-inner.ok { background: var(--warning-color); }
.seo-score-fill-inner.bad { background: var(--danger-color); }

/* Schema Validator */
.schema-validate-btn {
    margin-top: 6px;
}
.schema-valid-indicator {
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

/* Tab Content Wrapper for AJAX */
#seoTabContent {
    min-height: 300px;
}

/* Missing Alt Report */
.missing-alt-form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.missing-alt-form input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
}
.missing-alt-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .seo-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .seo-tab {
        flex-shrink: 0;
        font-size: 12px;
        padding: 8px 12px;
    }
    .mini-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .inline-form {
        flex-direction: column;
    }
    .inline-form .form-group {
        width: 100%;
    }
}
