/* Admin Specific Styles */

.admin-body {
    background-color: var(--bg-dark);
    margin: 0;
    overflow: hidden; /* Prevent body scroll, handle scroll in content */
}

.admin-wrapper {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: 100vh;
    border-radius: 0;
    border-right: 1px solid var(--border-glass);
    border-top: none; border-bottom: none; border-left: none;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-smooth);
    z-index: 100;
}

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    gap: 0.75rem;
}

.admin-logo { height: 35px; }
.admin-brand { font-weight: 700; font-size: 1.25rem; color: var(--text-main); }

.user-profile {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.avatar {
    width: 45px; height: 45px;
    background: rgba(255,215,0,0.1);
    color: var(--primary-yellow);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
}

.user-info h5 { margin: 0; font-size: 0.95rem; }
.user-info span { font-size: 0.8rem; color: var(--text-muted); }

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all var(--transition-fast);
    font-weight: 500;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    text-align: left;
}

.nav-item i { width: 20px; text-align: center; font-size: 1.1rem; }

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(255,215,0,0.1);
    color: var(--primary-yellow);
    border-right: 3px solid var(--primary-yellow);
    border-radius: 8px 0 0 8px;
}

.text-danger { color: #f87171 !important; }
.text-danger:hover { background: rgba(248, 113, 113, 0.1) !important; }

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-glass);
    display: flex; flex-direction: column; gap: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.topbar {
    height: 80px;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(11,14,20,0.8);
    backdrop-filter: blur(10px);
    z-index: 90;
}

body.light-mode .topbar {
    background: rgba(247, 250, 252, 0.9);
}

body.light-mode .admin-table th {
    background: rgba(0,0,0,0.05);
}

.topbar-search {
    display: flex; align-items: center;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    width: 300px;
}

.topbar-search i { color: var(--text-muted); margin-right: 0.5rem; }
.topbar-search input {
    background: none; border: none; color: white; width: 100%; outline: none;
}

.icon-btn {
    background: none; border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
    transition: color 0.2s;
}
.icon-btn:hover { color: var(--primary-yellow); }
.badge {
    position: absolute; top: 0; right: 0;
    background: #f87171; color: white;
    font-size: 0.6rem; font-weight: bold;
    padding: 2px 5px; border-radius: 10px;
}

.content-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    scroll-behavior: smooth;
}

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

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

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

.page-header { margin-bottom: 2rem; }
.page-header h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.page-header p { color: var(--text-muted); }

/* Dashboard Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    padding: 1.5rem;
    display: flex; flex-direction: column;
    position: relative;
}

.metric-icon {
    width: 50px; height: 50px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--text-main);
    margin-bottom: 1rem;
}
.bg-yellow { background: var(--primary-yellow); color: #000; }
.bg-danger { background: rgba(248, 113, 113, 0.2); color: #f87171; }

.metric-data h3 { font-size: 2rem; font-weight: 700; margin-bottom: 0.25rem; }
.metric-data span { color: var(--text-muted); font-size: 0.9rem; }

.metric-trend {
    position: absolute; top: 1.5rem; right: 1.5rem;
    font-size: 0.85rem; font-weight: 600;
    display: flex; align-items: center; gap: 0.25rem;
}
.positive { color: #34d399; }
.negative { color: #f87171; }

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

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

.admin-table th, .admin-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
}

.admin-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.2);
}

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

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px; font-size: 0.8rem; font-weight: 600;
}
.bg-success { background: rgba(52, 211, 153, 0.2); color: #34d399; }
.bg-warning { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }

/* Utilities */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.mt-4 { margin-top: 1.5rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* Support Layout */
.support-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 200px);
}

.ticket-list {
    overflow-y: auto;
    border-radius: 12px;
}

.ticket-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
    cursor: pointer;
    transition: background 0.2s;
}
.ticket-item:hover, .ticket-item.active { background: rgba(255,215,0,0.05); }

.ticket-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem;}
.ticket-user { font-weight: 600; }
.ticket-time { font-size: 0.8rem; color: var(--text-muted); }
.ticket-subject { font-size: 0.9rem; margin-bottom: 0.5rem; font-weight: 500; }
.ticket-preview { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ticket-viewer {
    padding: 2rem;
    overflow-y: auto;
    display: flex; flex-direction: column;
}

.viewer-empty {
    margin: auto; text-align: center; opacity: 0.5;
}

.reply-box {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-glass);
}
.reply-box textarea { width: 100%; margin-bottom: 1rem; }

/* Mobile Sidebar */
.d-mobile { display: none; }

@media (max-width: 992px) {
    .support-layout { grid-template-columns: 1fr; }
    .ticket-list { height: 300px; }
}

@media (max-width: 768px) {
    .sidebar { position: fixed; transform: translateX(-100%); width: 280px; }
    .sidebar.open { transform: translateX(0); }
    .d-mobile { display: block; }
}
