:root {
    --bg-base: #090d16;
    --bg-surface: rgba(18, 25, 41, 0.6);
    --border-color: rgba(255, 184, 76, 0.12);
    --border-color-hover: rgba(255, 184, 76, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #ffb84c; /* Gold/Orange accent */
    --accent-rgb: 255, 184, 76;
    --accent-gradient: linear-gradient(135deg, #ffb84c, #ff7e47);
    --error: #ef4444;
    --success: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

body {
    background: radial-gradient(circle at top right, #1a1528, #090d16);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Glass panel abstraction */
.glass {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.glass:hover {
    border-color: var(--border-color-hover);
}

/* Main portal structure */
.portal-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    width: 98vw;
    height: 96vh;
    max-width: 1600px;
    gap: 16px;
}

/* Sidebar Styling */
.sidebar {
    display: flex;
    flex-direction: column;
    padding: 24px;
    height: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
    position: relative;
}

.logo-glow {
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--accent);
    filter: blur(20px);
    opacity: 0.4;
    left: -5px;
    border-radius: 50%;
}

.logo-icon {
    font-size: 1.8rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    z-index: 1;
}

.brand h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 14px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
}

.nav-btn i {
    font-size: 1.1rem;
}

.nav-btn:hover {
    background: rgba(255, 184, 76, 0.05);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--accent-gradient);
    color: #090d16;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(255, 184, 76, 0.35);
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Content Area */
.content-area {
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
}

.tab-panel {
    display: none;
    height: 100%;
}

.tab-panel.active {
    display: block;
}

/* Headers & Subtext */
h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
}

.sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

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

.actions-group {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn-primary {
    background: var(--accent-gradient);
    color: #090d16;
    border: none;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(255, 184, 76, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 184, 76, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 500;
    cursor: pointer;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-block {
    width: 100%;
}

/* Form inputs & select */
.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"], input[type="email"], input[type="password"], select {
    width: 100%;
    background: rgba(9, 13, 22, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: 12px;
    outline: none;
    font-size: 0.95rem;
}

input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(255, 184, 76, 0.15);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Chat & Notification Tab Grid */
.chat-dashboard-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
    height: 100%;
}

.chat-box, .logs-box {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.message.user {
    background: var(--accent-gradient);
    color: #090d16;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 12px rgba(255, 184, 76, 0.15);
}

.message.system {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-input-area {
    padding: 18px 20px;
    display: flex;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-input-area input {
    flex: 1;
}

/* Logs Panel List */
.logs-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 14px 18px;
    border-left: 4px solid var(--accent);
}

.log-time {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.log-title {
    font-size: 0.92rem;
    font-weight: 600;
    margin-top: 4px;
}

.log-body {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Category Grid & Cards */
.categories-content {
    padding: 20px;
    height: calc(100% - 80px);
    overflow-y: auto;
}

.order-notice {
    background: rgba(255, 184, 76, 0.08);
    border: 1px solid rgba(255, 184, 76, 0.15);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.category-card {
    background: rgba(9, 13, 22, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 184, 76, 0.25);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.category-thumbnail {
    height: 140px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.category-order-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.category-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
}

.order-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-input {
    width: 60px;
    padding: 6px;
    text-align: center;
    border-radius: 8px;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.card-actions button {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.btn-card-edit {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.btn-card-edit:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-card-delete {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.btn-card-delete:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Filter Bar for Wallpapers */
.filter-bar {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    padding: 18px 24px;
    margin-bottom: 20px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-item label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Wallpapers grid & Card */
.wallpapers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.wallpaper-card {
    background: rgba(9, 13, 22, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.wallpaper-card:hover {
    border-color: rgba(255, 184, 76, 0.25);
    transform: translateY(-2px);
}

.wallpaper-preview {
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.wp-badge {
    position: absolute;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
}

.wp-locked-badge {
    top: 10px;
    right: 10px;
    background: rgba(239, 142, 68, 0.85);
    color: #090d16;
}

.wp-active-badge {
    top: 10px;
    left: 42px;
    background: rgba(16, 185, 129, 0.85);
    color: white;
}

.wp-inactive-badge {
    top: 10px;
    left: 42px;
    background: rgba(239, 68, 68, 0.85);
    color: white;
}

.wallpaper-details {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wallpaper-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wallpaper-details .meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.wp-card-footer {
    display: flex;
    gap: 6px;
}

.wp-card-footer button {
    flex: 1;
    padding: 8px 0;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(3, 5, 8, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    width: 90%;
    max-width: 480px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.auth-card {
    max-width: 400px;
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    font-size: 3rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.auth-header h2 {
    font-size: 1.6rem;
    margin-bottom: 2px;
}

.auth-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.error-msg {
    color: var(--error);
    font-size: 0.82rem;
    margin-top: 15px;
    text-align: center;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
}

.close-modal-btn:hover {
    color: white;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 18px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Loading/Empty State styling */
.loading-state, .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    gap: 12px;
    width: 100%;
}

.loading-state i {
    color: var(--accent);
}

/* Scrollbar tweaks */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color-hover);
}

/* Image Preview Box styling */
.preview-box {
    margin-top: 12px;
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 200px;
    overflow: hidden;
}

.preview-box img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 6px;
    object-fit: contain;
}

/* Custom styling for file input */
input[type="file"] {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-primary);
    width: 100%;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
    background: #e28e1c;
}

/* Switch styling */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #3e3e3e;
  transition: .3s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #c78200;
}
input:checked + .slider:before {
  transform: translateX(24px);
}

/* Card Selection Styles */
.card-select-checkbox-wrapper {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(9, 13, 22, 0.7);
    padding: 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.card-select-checkbox-wrapper:hover {
    background: rgba(9, 13, 22, 0.9);
    border-color: var(--accent);
}

.card-select-checkbox-wrapper input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    margin: 0;
}

.wallpaper-card.selected-for-delete {
    border-color: var(--accent) !important;
    box-shadow: 0 0 15px rgba(255, 184, 76, 0.2) !important;
}

/* Table Styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 15px;
    border-radius: 12px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: rgba(9, 13, 22, 0.3);
}

.admin-table th, .admin-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table th {
    background: rgba(255, 184, 76, 0.05);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.admin-table td {
    color: var(--text-primary);
    font-size: 0.9rem;
    vertical-align: middle;
}

.admin-table .badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-table .badge-pending {
    background: rgba(255, 184, 76, 0.15);
    color: #ffb84c;
}

.admin-table .badge-approved {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.admin-table .action-btns {
    display: flex;
    gap: 8px;
}

.admin-table .btn-action {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.admin-table .btn-approve {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.admin-table .btn-approve:hover {
    background: rgba(16, 185, 129, 0.35);
}

.admin-table .btn-reject {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.admin-table .btn-reject:hover {
    background: rgba(239, 68, 68, 0.3);
}
