/**
 * Eurotech Admin Control Panel Stylesheet
 * Fresh Modern Obsidian & Electric Cyan Theme
 */

:root {
    --bg-base: #0b0f19;
    --bg-surface: #111827;
    --bg-card: #1f2937;
    --bg-card-hover: #283548;
    --border: #374151;
    --border-light: #4b5563;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    
    --primary: #06b6d4;
    --primary-hover: #0891b2;
    --primary-glow: rgba(6, 182, 212, 0.25);
    
    --accent: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.2);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.15);
    
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
    min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 700; color: #fff; letter-spacing: -0.02em; }
a { color: var(--primary); text-decoration: none; transition: all 0.2s; }
a:hover { color: #38bdf8; }

/* Admin Layout Grid */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand-info h2 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin: 0;
    color: #fff;
}

.brand-info span {
    font-size: 11px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 14px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 1px;
    padding: 12px 14px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: var(--radius-sm);
    margin-bottom: 3px;
    transition: all 0.15s ease;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-left: 3px solid var(--primary);
    font-weight: 600;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    color: inherit;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    border: 1px solid var(--primary-glow);
}

.user-mini-info {
    flex: 1;
    overflow: hidden;
}

.user-mini-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-mini-role {
    font-size: 11px;
    color: var(--primary);
    text-transform: capitalize;
}

/* Main Content Area */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navbar */
.admin-topbar {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

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

.btn-view-site {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
}
.btn-view-site:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
}
.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Page Body */
.admin-body {
    flex: 1;
    padding: 32px;
}

/* Page Header */
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-title-group h1 {
    font-size: 24px;
    margin-bottom: 4px;
}
.page-title-group p {
    color: var(--text-muted);
    font-size: 13px;
}

/* KPI / Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, border-color 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 6px;
}
.stat-info p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon.cyan   { background: rgba(6, 182, 212, 0.15); color: var(--primary); }
.stat-icon.amber  { background: rgba(245, 158, 11, 0.15); color: var(--accent); }
.stat-icon.emerald{ background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-icon.blue   { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.stat-icon.rose   { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }
.stat-icon.purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }

/* Content Cards & Tables */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 28px;
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.card-header h2, .card-header h3 {
    font-size: 16px;
    margin: 0;
}

.card-body {
    padding: 24px;
}

.card-body.p-0 {
    padding: 0;
}

/* Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

table.admin-table th {
    background: #0f1523;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

table.admin-table td {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(55, 65, 81, 0.5);
    color: var(--text-main);
    vertical-align: middle;
}

table.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-pending   { background: var(--warning-bg); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-confirmed { background: var(--success-bg); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-cancelled { background: var(--danger-bg); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-active    { background: var(--success-bg); color: #34d399; }
.badge-inactive  { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.badge-new       { background: var(--info-bg); color: #60a5fa; }
.badge-read      { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.badge-replied   { background: var(--success-bg); color: #34d399; }
.badge-role      { background: rgba(6, 182, 212, 0.15); color: var(--primary); font-size: 10px; }

/* Filter Tabs */
.filter-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.filter-tab {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    transition: all 0.15s;
}
.filter-tab:hover {
    color: #fff;
    border-color: var(--border-light);
}
.filter-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Search Input */
.admin-search-wrap {
    position: relative;
    width: 240px;
    max-width: 100%;
}
.admin-search-wrap input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 14px 7px 34px;
    font-size: 12px;
    color: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-search-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.admin-search-wrap svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-dim);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
    box-shadow: 0 0 15px var(--primary-glow);
}
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-secondary:hover {
    color: #fff;
    border-color: var(--border-light);
}
.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    color: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}
.form-text {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: var(--success-bg); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.alert-danger  { background: var(--danger-bg);  color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.alert-warning { background: var(--warning-bg); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.alert-info    { background: var(--info-bg);    color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }

/* Thumb Preview */
.thumb-preview {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 50;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 520px;
    width: 100%;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-body {
    padding: 20px;
}
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #0f1523;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .mobile-toggle {
        display: block;
    }
}

/* Rich WYSIWYG Editor */
.rich-editor-container {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    overflow: hidden;
}
.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background: #0d1527;
    border-bottom: 1px solid var(--border);
}
.rich-editor-toolbar button {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.rich-editor-toolbar button:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.rich-separator {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 4px;
}
.rich-editor-content {
    min-height: 180px;
    max-height: 480px;
    overflow-y: auto;
    padding: 16px;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.6;
    outline: none;
}
.rich-editor-content:focus {
    background: rgba(6, 182, 212, 0.02);
}
.rich-editor-content h2, .rich-editor-content h3 {
    color: #fff;
    margin: 14px 0 8px;
}
.rich-editor-content p {
    margin-bottom: 10px;
}
.rich-editor-content ul, .rich-editor-content ol {
    margin: 10px 0 10px 24px;
}
.rich-editor-content a {
    color: var(--primary);
    text-decoration: underline;
}

