/*
 * EffortlessPOD Custom Admin Theme
 * Matches the frontend design system
 */

/* ==========================================
   CSS VARIABLES - Design Tokens
   ========================================== */

/* Dark Mode (Default) */
:root,
[data-theme="dark"] {
    --razor: #df0050;
    --razor-dark: #b8003f;
    --cyber: #00c9d3;
    --cyber-dark: #00a8b0;
    --darkbg: #050505;
    --panel: #111111;
    --panel-lighter: #1a1a1a;
    --panel-border: #222222;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-neon-pink: 0 0 15px rgba(223, 0, 80, 0.4);
    --shadow-neon-teal: 0 0 15px rgba(0, 201, 211, 0.3);
}

/* Light Mode - Professional clean look */
[data-theme="light"] {
    --darkbg: #f8fafc;
    --panel: #ffffff;
    --panel-lighter: #f1f5f9;
    --panel-border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    /* Lighter shadows for light mode */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-neon-pink: 0 0 10px rgba(223, 0, 80, 0.15);
    --shadow-neon-teal: 0 0 10px rgba(0, 201, 211, 0.15);
}

/* ==========================================
   BASE STYLES
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

* {
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: var(--font-sans);
    background: var(--darkbg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

::-webkit-scrollbar-track {
    background: var(--panel);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

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

/* ==========================================
   HEADER / TOP BAR
   ========================================== */
#header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: none;
    padding: 0 28px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    height: 70px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#branding {
    display: none;
    /* Hide default branding container if it exists */
}

/* Site branding container */
#site-branding {
    display: flex;
    align-items: center;
    gap: 16px;
}

#branded-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--razor), #f97316);
    border-radius: 10px;
    color: white;
    box-shadow: 0 4px 12px rgba(223, 0, 80, 0.3);
}

#site-name {
    margin: 0;
}

#site-name a {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.02em;
    font-family: var(--font-sans);
}

/* User tools container */
#user-tools {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* User Profile Section */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--cyber) 0%, #3b82f6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 201, 211, 0.3);
}

.user-name {
    font-weight: 600;
    color: white;
}

.tools-separator {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 8px;
}

/* Tool Buttons */
.tool-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    /* Pill shape */
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
}

.tool-btn.icon-only {
    padding: 8px;
    border-radius: 50%;
    /* Circle shape for icon only */
    width: 36px;
    height: 36px;
    justify-content: center;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.tool-btn.logout:hover {
    background: rgba(223, 0, 80, 0.15);
    border-color: rgba(223, 0, 80, 0.3);
    color: var(--razor);
}

/* Logout form reset */
#logout-form {
    margin: 0;
}

#logout-form button {
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

/* ==========================================
   MAIN LAYOUT
   ========================================== */
#container {
    display: flex;
    min-height: calc(100vh - 64px);
}

#main {
    flex: 1;
    padding: 32px;
    max-width: 100%;
    overflow-x: hidden;
}

/* ==========================================
   SIDEBAR NAVIGATION
   ========================================== */
#nav-sidebar {
    width: 260px;
    background: var(--panel);
    border-right: 1px solid var(--panel-border);
    padding: 24px 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.nav-sidebar {
    background: var(--panel);
}

/* App/Section headers */
#nav-sidebar .module caption {
    display: block;
    background: transparent;
    padding: 16px 24px 8px 24px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border: none;
}

#nav-sidebar table {
    width: 100%;
    border-collapse: collapse;
}

/* Model rows - show as flex container */
#nav-sidebar tr {
    display: flex;
    align-items: center;
    padding: 0;
}

/* Model name cell (th) - show it! */
#nav-sidebar th {
    display: block;
    flex: 1;
    padding: 0;
    background: transparent;
    border: none;
    text-transform: none;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

/* Model name link */
#nav-sidebar th a {
    display: block;
    padding: 10px 16px 10px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

#nav-sidebar th a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-left-color: var(--razor);
}

/* Add link cell (td) */
#nav-sidebar td {
    display: block;
    padding: 10px 16px 10px 0;
}

/* Add/Change links - small inline buttons */
#nav-sidebar .addlink,
#nav-sidebar .changelink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    padding: 4px 8px;
    background: var(--panel-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    border-left: none;
    transition: all 0.2s ease;
}

#nav-sidebar .addlink:hover,
#nav-sidebar .changelink:hover {
    background: var(--razor);
    color: white;
}

/* Toggle button for sidebar */
#toggle-nav-sidebar {
    display: none;
}

/* ==========================================
   SIDEBAR FILTER / SEARCH INPUT
   ========================================== */
#nav-sidebar input[type="text"],
#nav-sidebar input[type="search"],
#nav-sidebar #nav-filter {
    width: calc(100% - 48px);
    margin: 0 24px 20px 24px;
    padding: 10px 14px;
    background: var(--darkbg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    transition: all 0.2s ease;
    outline: none;
}

#nav-sidebar input[type="text"]::placeholder,
#nav-sidebar input[type="search"]::placeholder,
#nav-sidebar #nav-filter::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

#nav-sidebar input[type="text"]:focus,
#nav-sidebar input[type="search"]:focus,
#nav-sidebar #nav-filter:focus {
    border-color: var(--cyber);
    box-shadow: 0 0 0 3px rgba(0, 201, 211, 0.12);
    background: var(--panel);
}

/* Light mode adjustments for sidebar filter */
[data-theme="light"] #nav-sidebar input[type="text"],
[data-theme="light"] #nav-sidebar input[type="search"],
[data-theme="light"] #nav-sidebar #nav-filter {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] #nav-sidebar input:focus {
    border-color: var(--cyber);
    box-shadow: 0 0 0 3px rgba(0, 201, 211, 0.1);
}

/* Light mode sidebar section headers (ACCOUNTS, CMS, etc.) */
[data-theme="light"] #nav-sidebar .module caption {
    color: #64748b;
    font-weight: 700;
}

/* Light mode section class headers */
[data-theme="light"] .section,
[data-theme="light"] #nav-sidebar .section,
[data-theme="light"] caption.section {
    color: #475569 !important;
}

/* Light mode model links */
[data-theme="light"] #nav-sidebar th a {
    color: #334155;
}

[data-theme="light"] #nav-sidebar th a:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
    border-left-color: var(--razor);
}

/* Light mode Add buttons */
[data-theme="light"] #nav-sidebar .addlink,
[data-theme="light"] #nav-sidebar .changelink {
    background: #e2e8f0;
    color: #64748b;
}

[data-theme="light"] #nav-sidebar .addlink:hover,
[data-theme="light"] #nav-sidebar .changelink:hover {
    background: var(--razor);
    color: white;
}

/* ==========================================
   BREADCRUMBS
   ========================================== */
.breadcrumbs {
    background: transparent;
    padding: 0 0 24px 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--razor);
}

/* ==========================================
   DASHBOARD STATS GRID
   ========================================== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--panel-lighter);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 2px;
}

.stat-card-icon.users {
    background: linear-gradient(135deg, rgba(223, 0, 80, 0.2), rgba(223, 0, 80, 0.05));
    border: 1px solid rgba(223, 0, 80, 0.15);
    color: var(--razor);
}

.stat-card-icon.posts {
    background: linear-gradient(135deg, rgba(0, 201, 211, 0.2), rgba(0, 201, 211, 0.05));
    border: 1px solid rgba(0, 201, 211, 0.15);
    color: var(--cyber);
}

.stat-card-icon.subs {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.stat-card-icon.config {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.stat-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-card-meta .positive {
    color: var(--success);
}

.stat-card-meta .negative {
    color: var(--error);
}

/* ==========================================
   DASHBOARD CHARTS
   ========================================== */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

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

.chart-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-container {
    height: 250px;
    position: relative;
}

/* ==========================================
   RECENT ACTIVITY
   ========================================== */
.dashboard-activity {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.activity-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.activity-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--panel-border);
}

.activity-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--razor), #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-badge {
    font-size: 0.65rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-transform: uppercase;
}

.activity-badge.new {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.activity-badge.draft {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.activity-badge.published {
    background: rgba(0, 201, 211, 0.15);
    color: var(--cyber);
}

/* ==========================================
   MODULE / CONTENT BOXES
   ========================================== */
.module {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
}

.module h2,
.module caption {
    background: var(--panel-lighter);
    padding: 16px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    border-bottom: 1px solid var(--panel-border);
}

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

.module th {
    text-align: left;
    padding: 12px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--panel-border);
}

.module td {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.module tr:last-child td {
    border-bottom: none;
}

.module tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.module a {
    color: var(--cyber);
    text-decoration: none;
}

.module a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* ==========================================
   BUTTONS
   ========================================== */
.button,
input[type="submit"],
input[type="button"],
.submit-row input,
button {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.button.default,
input[type="submit"],
.submit-row input[type="submit"] {
    background: var(--razor);
    color: white;
    box-shadow: 0 4px 12px rgba(223, 0, 80, 0.3);
}

.button.default:hover,
input[type="submit"]:hover,
.submit-row input[type="submit"]:hover {
    background: var(--razor-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(223, 0, 80, 0.4);
}

.button:not(.default),
input[type="button"] {
    background: var(--panel-lighter);
    color: var(--text-secondary);
    border: 1px solid var(--panel-border);
}

.button:not(.default):hover,
input[type="button"]:hover {
    background: var(--panel);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.deletelink {
    color: var(--error) !important;
}

.deletelink:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ==========================================
   FORMS
   ========================================== */
.form-row {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.form-row:last-child {
    border-bottom: none;
}

.form-row label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-row .help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea {
    width: 100%;
    max-width: 600px;
    padding: 12px 16px;
    background: var(--darkbg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

select {
    width: 100%;
    max-width: 600px;
    padding: 8px 40px 8px 16px;
    height: auto;
    min-height: 42px;
    background: var(--darkbg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--cyber);
    box-shadow: 0 0 0 3px rgba(0, 201, 211, 0.15);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Light mode form inputs styling */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="url"],
[data-theme="light"] textarea {
    background-color: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] select {
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
    color: #94a3b8;
}

[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus {
    border-color: var(--cyber);
    box-shadow: 0 0 0 3px rgba(0, 201, 211, 0.1);
    background-color: #ffffff;
}

[data-theme="light"] select:focus {
    border-color: var(--cyber);
    box-shadow: 0 0 0 3px rgba(0, 201, 211, 0.1);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--razor);
    cursor: pointer;
}

/* ==========================================
   SUBMIT ROW
   ========================================== */
.submit-row {
    background: var(--panel);
    padding: 20px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.submit-row p {
    margin: 0;
}

/* ==========================================
   CHANGELIST / RESULTS TABLE
   ========================================== */

/* Main changelist container */
#changelist {
    padding: 0;
}

/* Search form styling - Premium design */
#changelist #changelist-search,
#changelist-search,
form#changelist-search {
    display: flex;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--panel) 0%, var(--panel-lighter) 100%);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Make the inner container (div) also flex horizontal */
#changelist-search>div,
form#changelist-search>div {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 16px !important;
    flex: 1;
    width: 100%;
}

/* Search icon styling */
#changelist-search label,
form#changelist-search label {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 1.5rem;
    flex-shrink: 0;
    height: 56px;
    margin: 0 !important;
}

#changelist-search #searchbar,
#changelist-search input[type="text"],
form#changelist-search input[type="text"],
#toolbar #searchbar {
    flex: 1;
    min-width: 200px;
    height: 56px !important;
    padding: 0 24px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 2px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    color: var(--text-primary) !important;
    font-family: var(--font-sans);
    font-size: 1rem !important;
    transition: all 0.25s ease;
    box-sizing: border-box !important;
}

#changelist-search #searchbar::placeholder,
#changelist-search input[type="text"]::placeholder {
    color: var(--text-muted);
}

#changelist-search #searchbar:focus,
#changelist-search input[type="text"]:focus {
    outline: none;
    border-color: var(--cyber) !important;
    box-shadow: 0 0 0 4px rgba(0, 201, 211, 0.2);
    background: rgba(255, 255, 255, 0.12) !important;
}

#changelist-search input[type="submit"],
form#changelist-search input[type="submit"] {
    height: 56px;
    padding: 0 32px !important;
    background: linear-gradient(135deg, var(--razor) 0%, var(--razor-dark) 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    color: white !important;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(223, 0, 80, 0.3);
    flex-shrink: 0;
    white-space: nowrap;
}

#changelist-search input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(223, 0, 80, 0.4);
}

/* Light mode search box */
[data-theme="light"] #changelist-search,
[data-theme="light"] form#changelist-search {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-color: #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] #changelist-search #searchbar,
[data-theme="light"] #changelist-search input[type="text"] {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

[data-theme="light"] #changelist-search #searchbar:focus,
[data-theme="light"] #changelist-search input[type="text"]:focus {
    background: #ffffff !important;
    border-color: var(--cyber) !important;
}

/* Action bar styling */
/* Action bar styling - Premium design */
#changelist .actions,
.changelist .actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--panel) 0%, var(--panel-lighter) 100%);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#changelist .actions label {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#changelist .actions select {
    min-width: 280px;
    padding: 12px 44px 12px 16px !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 2px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    color: var(--text-primary) !important;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23aaa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    cursor: pointer;
    transition: all 0.25s ease;
}

#changelist .actions select:focus {
    border-color: var(--cyber) !important;
    box-shadow: 0 0 0 4px rgba(0, 201, 211, 0.2);
    outline: none;
}

#changelist .actions button,
#changelist .actions input[type="submit"] {
    padding: 12px 24px !important;
    background: linear-gradient(135deg, var(--panel-lighter) 0%, var(--panel) 100%) !important;
    border: 2px solid var(--panel-border) !important;
    border-radius: 12px !important;
    color: var(--text-primary) !important;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
}

#changelist .actions button:hover,
#changelist .actions input[type="submit"]:hover {
    background: linear-gradient(135deg, var(--razor) 0%, var(--razor-dark) 100%) !important;
    border-color: var(--razor) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(223, 0, 80, 0.3);
}

#changelist .actions .action-counter,
.actions span.action-counter {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-left: auto;
    font-weight: 500;
}

/* Light mode action bar */
[data-theme="light"] #changelist .actions {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] #changelist .actions select {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

[data-theme="light"] #changelist .actions button {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #334155;
}

[data-theme="light"] #changelist .actions button:hover {
    background: var(--razor);
    border-color: var(--razor);
    color: white;
}

/* Filter panel styling - Premium design */
#changelist-filter {
    background: linear-gradient(135deg, var(--panel) 0%, var(--panel-lighter) 100%);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 24px;
    min-width: 240px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#changelist-filter h2 {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 20px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--panel-border);
}

#changelist-filter h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 20px 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

#changelist-filter h3::before {
    content: '↓';
    color: var(--cyber);
    font-size: 0.9rem;
}

#changelist-filter ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#changelist-filter li {
    margin: 0;
}

#changelist-filter li a {
    display: block;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

#changelist-filter li a:hover {
    background: rgba(0, 201, 211, 0.08);
    color: var(--text-primary);
    transform: translateX(4px);
}

#changelist-filter li.selected a {
    background: linear-gradient(135deg, rgba(0, 201, 211, 0.15) 0%, rgba(0, 201, 211, 0.08) 100%);
    color: var(--cyber);
    font-weight: 700;
    border-left: 3px solid var(--cyber);
}

/* Light mode filter panel */
[data-theme="light"] #changelist-filter {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] #changelist-filter h2 {
    color: #64748b;
    border-color: #e2e8f0;
}

[data-theme="light"] #changelist-filter h3 {
    color: #334155;
}

[data-theme="light"] #changelist-filter li a {
    color: #64748b;
}

[data-theme="light"] #changelist-filter li a:hover {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="light"] #changelist-filter li.selected a {
    background: rgba(0, 201, 211, 0.1);
    color: #0891b2;
}

/* Results table - Premium design */
#result_list {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#result_list thead th {
    background: linear-gradient(135deg, var(--panel-lighter) 0%, var(--panel) 100%);
    padding: 16px 20px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: left;
    border-bottom: 2px solid var(--panel-border);
}

#result_list thead th a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

#result_list thead th a:hover {
    color: var(--cyber);
}

#result_list tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

#result_list tbody tr:last-child td {
    border-bottom: none;
}

#result_list tbody tr {
    transition: all 0.2s ease;
}

#result_list tbody tr:hover td {
    background: rgba(0, 201, 211, 0.05);
}

#result_list tbody a {
    color: var(--cyber);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.15s ease;
}

#result_list tbody a:hover {
    color: var(--razor);
    text-decoration: none;
}

/* Light mode table */
[data-theme="light"] #result_list {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] #result_list thead th {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

[data-theme="light"] #result_list thead th a {
    color: #64748b;
}

[data-theme="light"] #result_list thead th a:hover {
    color: #0f172a;
}

[data-theme="light"] #result_list tbody td {
    border-color: #f1f5f9;
    color: #475569;
}

[data-theme="light"] #result_list tbody tr:hover td {
    background: #f8fafc;
}

[data-theme="light"] #result_list tbody a {
    color: #0891b2;
}

/* Pagination styling */
.paginator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.paginator a {
    padding: 6px 12px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
}

.paginator a:hover {
    background: var(--razor);
    border-color: var(--razor);
    color: white;
}

[data-theme="light"] .paginator a {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #64748b;
}

[data-theme="light"] .paginator a:hover {
    background: var(--razor);
    color: white;
}

/* Counter text */
.actions .action-counter,
p.paginator {
    color: var(--text-muted);
}

[data-theme="light"] .actions .action-counter,
[data-theme="light"] p.paginator {
    color: #64748b;
}

/* ==========================================
   OBJECT TOOLS (Action buttons)
   ========================================== */
.object-tools {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    list-style: none;
    padding: 0;
}

.object-tools li {
    margin: 0;
}

.object-tools a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.object-tools a:hover {
    background: var(--panel-lighter);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.object-tools .addlink {
    background: var(--razor);
    border-color: var(--razor);
    color: white;
}

.object-tools .addlink:hover {
    background: var(--razor-dark);
    border-color: var(--razor-dark);
}

/* ==========================================
   MESSAGES / ALERTS
   ========================================== */
.messagelist {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.messagelist li {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.messagelist .success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.messagelist .warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.messagelist .error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.messagelist .info {
    background: rgba(0, 201, 211, 0.1);
    border: 1px solid rgba(0, 201, 211, 0.3);
    color: var(--cyber);
}

/* ==========================================
   LOGIN PAGE
   ========================================== */
body.login {
    background: linear-gradient(135deg, var(--darkbg) 0%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

body.login #header {
    display: none;
}

body.login #container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 24px;
}

body.login #content {
    width: 100%;
}

body.login h1 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 32px;
    color: var(--text-primary);
}

body.login h1 a {
    color: inherit;
    text-decoration: none;
}

body.login #content-main {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

body.login .form-row {
    margin-bottom: 20px;
    padding: 0;
    border: none;
}

body.login .form-row label {
    margin-bottom: 10px;
}

body.login input[type="text"],
body.login input[type="password"] {
    max-width: 100%;
}

body.login .submit-row {
    background: transparent;
    padding: 20px 0 0 0;
    border: none;
    position: static;
}

body.login input[type="submit"] {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media screen and (max-width: 1024px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }

    .dashboard-activity {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    #nav-sidebar {
        position: fixed;
        left: -280px;
        top: 64px;
        height: calc(100vh - 64px);
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
    }

    #nav-sidebar.active {
        left: 0;
    }

    #toggle-nav-sidebar {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--panel-lighter);
        border: 1px solid var(--panel-border);
        border-radius: var(--radius-md);
        color: var(--text-secondary);
        cursor: pointer;
        margin-right: 12px;
    }

    #main {
        padding: 20px;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .stat-card-value {
        font-size: 2rem;
    }

    .submit-row {
        flex-direction: column;
        gap: 10px;
    }

    .submit-row input {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    #header {
        padding: 0 16px;
    }

    #branding h1 {
        font-size: 1rem;
    }

    #site-name::before {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }

    #main {
        padding: 16px;
    }

    .stat-card {
        padding: 20px;
    }

    .chart-card,
    .activity-card {
        padding: 20px;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.chart-card,
.activity-card {
    animation: fadeIn 0.4s ease forwards;
}

.stat-card:nth-child(1) {
    animation-delay: 0.05s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.15s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.2s;
}

/* ==========================================
   UTILITIES
   ========================================== */
.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

.font-mono {
    font-family: var(--font-mono);
}