/* ===================================
   HelpDesk Ticketing - Design System
   Dark Navy Theme
   =================================== */

/* ---- Import Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
    /* Backgrounds */
    --bg-primary: #0B1120;
    --bg-secondary: #111827;
    --bg-card: #1A2332;
    --bg-input: #1A2332;
    --bg-sidebar: #0F1629;
    --bg-hover: #1E293B;

    /* Borders */
    --border: #1E293B;
    --border-light: #2D3748;
    --border-focus: #3B82F6;

    /* Text */
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-heading: #E2E8F0;

    /* Accent Colors */
    --accent: #3B82F6;
    --accent-hover: #2563EB;
    --accent-light: rgba(59, 130, 246, 0.15);
    --accent-glow: rgba(59, 130, 246, 0.3);

    /* Status Colors */
    --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: #06B6D4;
    --info-bg: rgba(6, 182, 212, 0.15);
    --purple: #8B5CF6;
    --purple-bg: rgba(139, 92, 246, 0.15);

    /* Sizing */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --sidebar-width: 250px;

    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* ---- Light Theme ---- */
[data-theme="light"] {
    /* Backgrounds */
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-input: #F1F5F9;
    --bg-sidebar: #FFFFFF;
    --bg-hover: #F1F5F9;

    /* Borders */
    --border: #E2E8F0;
    --border-light: #CBD5E1;
    --border-focus: #3B82F6;

    /* Text */
    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-heading: #0F172A;

    /* Status Colors (stronger for light bg) */
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.1);
    --warning: #D97706;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --danger: #DC2626;
    --danger-bg: rgba(220, 38, 38, 0.1);
    --info: #0891B2;
    --info-bg: rgba(8, 145, 178, 0.1);
    --purple: #7C3AED;
    --purple-bg: rgba(124, 58, 237, 0.1);
}

/* ---- Grey Theme ---- */
[data-theme="grey"] {
    /* Backgrounds */
    --bg-primary: #2A2D35;
    --bg-secondary: #33363F;
    --bg-card: #3A3D47;
    --bg-input: #3A3D47;
    --bg-sidebar: #2A2D35;
    --bg-hover: #44475250;

    /* Borders */
    --border: #4A4D57;
    --border-light: #5A5D67;
    --border-focus: #3B82F6;

    /* Text */
    --text-primary: #E8EAF0;
    --text-secondary: #B0B4C0;
    --text-muted: #808490;
    --text-heading: #F0F2F8;

    /* Status Colors */
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.18);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.18);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.18);
    --info: #06B6D4;
    --info-bg: rgba(6, 182, 212, 0.18);
    --purple: #8B5CF6;
    --purple-bg: rgba(139, 92, 246, 0.18);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    padding-top: var(--banner-height, 0px);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- Typography ---- */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-heading);
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
}

/* ---- Layout Utilities ---- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-sm {
    gap: 8px;
}

.gap-md {
    gap: 16px;
}

.gap-lg {
    gap: 24px;
}

.gap-xl {
    gap: 32px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #059669;
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* ---- Form Elements ---- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    padding-left: 40px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-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 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

.form-textarea {
    padding-left: 14px;
    resize: vertical;
    min-height: 100px;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.input-icon-wrapper .form-select {
    padding-left: 40px;
}

.form-input.no-icon,
.form-textarea.no-icon {
    padding-left: 14px;
}

/* ---- Cards ---- */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-light);
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    gap: 4px;
}

.badge-queued {
    background: rgba(229, 231, 235, 0.15);
    color: #E5E7EB;
}

.badge-open {
    background: rgba(59, 130, 246, 0.15);
    color: #3B82F6;
}

.badge-process {
    background: rgba(99, 102, 241, 0.15);
    color: #6366F1;
}

.badge-hold {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}

.badge-escalate {
    background: rgba(236, 72, 153, 0.15);
    color: #EC4899;
}

.badge-monitor {
    background: rgba(6, 182, 212, 0.15);
    color: #06B6D4;
}

.badge-complete {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.badge-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

/* Keep badge-solved as alias for backward compat in non-ticket contexts */
.badge-solved {
    background: var(--success-bg);
    color: var(--success);
}

.badge-low {
    color: var(--success);
}

.badge-medium {
    color: var(--warning);
}

.badge-high {
    color: #F97316;
}

.badge-urgent {
    color: var(--danger);
}

/* ---- Priority Dot ---- */
.priority-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.priority-dot::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.priority-dot.low::before {
    background: var(--success);
}

.priority-dot.medium::before {
    background: var(--warning);
}

.priority-dot.high::before {
    background: #F97316;
}

.priority-dot.urgent::before {
    background: var(--danger);
}

/* ---- Tables ---- */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
}

.data-table tr:hover td {
    background: var(--bg-hover);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* ---- Avatar ---- */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.avatar-blue {
    background: var(--accent);
}

.avatar-green {
    background: var(--success);
}

.avatar-orange {
    background: #F97316;
}

.avatar-purple {
    background: var(--purple);
}

/* =================================
   PUBLIC PAGES
   ================================= */

/* ---- Public Header ---- */
.public-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.public-header .container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.header-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ---- Public Footer ---- */
.public-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    margin-top: auto;
}

.public-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-text {
    color: var(--text-muted);
    font-size: 13px;
}

.footer-links {
    display: flex;
    gap: 12px;
}

.footer-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition);
}

.footer-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- Home Page Layout ---- */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    min-height: calc(100vh - 110px);
    padding: 16px 0;
    align-items: start;
}

/* ---- Hero Section (Left) ---- */
.hero-section {
    padding-top: 24px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 50px;
    color: var(--success);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.hero-title .highlight {
    color: var(--accent);
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 40px;
    max-width: 420px;
}

/* ---- Search Ticket Box ---- */
.search-ticket-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
}

.search-ticket-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.search-ticket-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
}

.search-ticket-form {
    display: flex;
    gap: 12px;
}

.search-ticket-form .form-input {
    flex: 1;
}

.search-ticket-form .btn {
    min-width: 80px;
}

/* ---- Feature Cards ---- */
.feature-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 20px;
}

.feature-icon.blue {
    background: var(--accent-light);
    color: var(--accent);
}

.feature-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.feature-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ---- Form Section (Right) ---- */
.form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.form-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-required-badge {
    padding: 4px 12px;
    background: var(--accent-light);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-xs);
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

/* ---- File Upload Area ---- */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.upload-area:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.upload-area.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.upload-icon {
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.upload-text .link {
    color: var(--accent);
    font-weight: 500;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.uploaded-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 12px;
}

.uploaded-file-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uploaded-file-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}

/* ---- CAPTCHA ---- */
.captcha-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
}

.captcha-question {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-label {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

.captcha-input {
    width: 80px;
    text-align: center;
    padding: 10px !important;
    padding-left: 10px !important;
    font-size: 16px;
    font-weight: 600;
}

/* ---- Success Page ---- */
.success-page {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    max-width: 480px;
    width: 100%;
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--success-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: var(--success);
}

.success-card h2 {
    margin-bottom: 12px;
}

.success-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.ticket-id-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 24px;
    margin-bottom: 24px;
}

.ticket-id-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
}

.copy-btn {
    background: var(--accent-light);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-xs);
    padding: 6px 12px;
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--accent);
    color: #fff;
}

/* ---- Tracking Page ---- */
.tracking-page {
    padding: 48px 0;
    max-width: 800px;
    margin: 0 auto;
}

.tracking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.tracking-ticket-id {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
}

/* ---- Timeline ---- */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.timeline-dot.created {
    background: var(--accent-light);
    color: var(--accent);
    border: 2px solid var(--accent);
}

.timeline-dot.assigned {
    background: var(--warning-bg);
    color: var(--warning);
    border: 2px solid var(--warning);
}

.timeline-dot.open {
    background: var(--info-bg);
    color: var(--info);
    border: 2px solid var(--info);
}

.timeline-dot.solved {
    background: var(--success-bg);
    color: var(--success);
    border: 2px solid var(--success);
}

.timeline-dot.rejected {
    background: var(--danger-bg);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.timeline-dot.status_changed {
    background: var(--warning-bg);
    color: var(--warning);
    border: 2px solid var(--warning);
}

.timeline-dot.completed {
    background: var(--success-bg);
    color: var(--success);
    border: 2px solid var(--success);
}

.timeline-dot.follow_up {
    background: var(--purple-bg);
    color: var(--purple);
    border: 2px solid var(--purple);
}

.timeline-dot.escalated {
    background: var(--warning-bg);
    color: var(--warning);
    border: 2px solid var(--warning);
}

.timeline-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ---- Resolution Notes ---- */
.resolution-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-top: 24px;
}

.resolution-box h4 {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resolution-box p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

.resolution-empty {
    color: var(--text-muted);
    font-style: italic;
}

/* =================================
   ADMIN PAGES
   ================================= */

/* ---- Admin Login ---- */
.login-page {
    min-height: calc(100vh - 115px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--bg-body, #0B1120) 0%, #1a1a3e 50%, var(--bg-body, #0B1120) 100%);
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    width: 56px;
    height: 56px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    color: #fff;
}

.login-card h2 {
    margin-bottom: 8px;
}

.login-card .login-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.login-form .form-group {
    margin-bottom: 16px;
    text-align: left;
}

.login-footer {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ---- Admin Layout ---- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--banner-height, 0px);
    left: 0;
    bottom: 0;
    z-index: 200;
    transition: var(--transition-slow);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition-slow);
}

.sidebar-brand {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-version {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    transition: var(--transition);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--accent);
    color: #fff;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-right: 12px;
    border-left-color: transparent;
    font-weight: 500;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.sidebar-footer .sidebar-link {
    padding: 10px 0;
}

/* ---- Admin Main Content ---- */
.admin-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ---- Topbar ---- */
.topbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: var(--banner-height, 0px);
    z-index: 100;
}

.topbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-notification {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.topbar-notification:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user-info {
    text-align: right;
}

.topbar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.topbar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

/* ---- Dashboard Content ---- */
.admin-content {
    flex: 1;
    padding: 24px;
    background: var(--bg-primary);
    overflow-x: hidden;
    min-width: 0;
}

/* ---- Stat Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stat-change {
    font-size: 12px;
    font-weight: 500;
}

.stat-change.up {
    color: var(--success);
}

.stat-change.down {
    color: var(--danger);
}

.stat-change.neutral {
    color: var(--text-muted);
}

.stat-change.ok {
    color: var(--success);
}

/* ---- Chart Section ---- */
.chart-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.chart-title h3 {
    margin-bottom: 4px;
}

.chart-title p {
    color: var(--text-muted);
    font-size: 13px;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.chart-filter select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.chart-container {
    height: 280px;
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

/* ---- Recent Table Section ---- */
.recent-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

/* ---- Alert Messages ---- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.pagination .active span {
    background: var(--accent);
    color: #fff;
}

/* ---- Modal ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-backdrop.show {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* ---- Hamburger for Mobile ---- */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .home-layout {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 32px 0;
    }

    .hero-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .captcha-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-user-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .feature-cards {
        grid-template-columns: 1fr;
    }

    .search-ticket-form {
        flex-direction: column;
    }

    .hero-title {
        font-size: 1.8rem;
    }
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
}

/* ---- Toast Notification ---- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ---- Page Header (Admin inner pages) ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 20px;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ---- Ticket Detail (Admin) ---- */
.ticket-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.ticket-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- Settings Pages ---- */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .ticket-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* =================================
   TRANSLATION EDITOR
   ================================= */

/* ---- Group Pills ---- */
.translation-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.translation-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.translation-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.translation-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pill-count {
    background: rgba(255, 255, 255, 0.15);
    padding: 1px 7px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.translation-pill.active .pill-count {
    background: rgba(255, 255, 255, 0.25);
}

/* ---- Translation Table ---- */
.translation-table td {
    vertical-align: top;
    padding: 10px 12px;
}

.translation-table th {
    padding: 12px;
}

.group-tag {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.translation-key {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12.5px;
    color: var(--accent);
    background: var(--accent-light);
    padding: 3px 8px;
    border-radius: 4px;
    word-break: break-all;
}

.lang-badge {
    display: inline-flex;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-left: 6px;
    vertical-align: middle;
}

.lang-badge.primary {
    background: var(--accent-light);
    color: var(--accent);
}

.lang-badge.secondary {
    background: var(--success-bg);
    color: var(--success);
}

/* ---- Translation Inputs ---- */
.translation-cell {
    position: relative;
}

.translation-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    padding: 8px 12px;
    resize: none;
    overflow: hidden;
    transition: var(--transition);
    outline: none;
}

.translation-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.translation-input.changed {
    border-color: var(--warning);
    box-shadow: 0 0 0 2px var(--warning-bg);
    background: rgba(245, 158, 11, 0.05);
}

.en-input {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.en-input:focus {
    background: var(--bg-card);
    border-color: var(--accent);
}

.id-cell .edit-icon {
    position: absolute;
    right: 12px;
    top: 12px;
    color: var(--text-muted);
    font-size: 11px;
    opacity: 0.5;
    pointer-events: none;
    transition: var(--transition);
}

.id-cell:hover .edit-icon {
    opacity: 1;
    color: var(--success);
}

.btn-icon-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 13px;
}

.btn-icon-delete:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* =================================
   USER DROPDOWN MENU
   ================================= */

.topbar-user-dropdown {
    position: relative;
}

.topbar-user-dropdown .topbar-user {
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
}

.topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 100;
}

.topbar-user-dropdown.open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    background: none;
    border: none;
    font-family: inherit;
    width: 100%;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-item.danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* =================================
   PROFILE PAGE
   ================================= */

.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

.profile-avatar-card {
    text-align: center;
    padding: 32px 24px;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid var(--accent);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
}

.profile-forms {
    min-width: 0;
}

.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.avatar-upload-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar-upload-preview {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--border);
    flex-shrink: 0;
    color: var(--text-muted);
}

.avatar-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .form-grid-2col {
        grid-template-columns: 1fr;
    }
}

/* =================================
   SIDEBAR LOGO
   ================================= */

.sidebar-logo {
    height: 36px;
    border-radius: 6px;
    margin-bottom: 8px;
}

/* =================================
   THEME TOGGLE & COLOR PALETTE
   ================================= */

.theme-toggle-group {
    display: flex;
    gap: 8px;
}

.theme-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.theme-option input {
    display: none;
}

.theme-option:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.theme-option.active {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.color-palette {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--swatch-color);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid transparent;
    transition: var(--transition);
}

.color-swatch input {
    display: none;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

.color-swatch i {
    color: #fff;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* =================================
   LIGHT THEME SPECIFIC OVERRIDES
   ================================= */

[data-theme="light"] .sidebar {
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .topbar {
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
}

[data-theme="light"] .data-table th {
    background: #F1F5F9;
    color: #475569;
}

[data-theme="light"] .data-table td {
    border-bottom: 1px solid #F1F5F9;
}

[data-theme="light"] .sidebar-link.active {
    background: var(--accent-light);
    color: var(--accent);
}

[data-theme="light"] .stat-card {
    border: 1px solid var(--border);
}

[data-theme="light"] .form-select,
[data-theme="light"] .form-input {
    border: 1px solid #CBD5E1;
}

[data-theme="light"] .btn-outline {
    border-color: #CBD5E1;
    color: var(--text-secondary);
}

[data-theme="light"] .btn-outline:hover {
    background: #F1F5F9;
    border-color: var(--accent);
    color: var(--accent);
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: #F1F5F9;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #CBD5E1;
}

[data-theme="light"] .public-header {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .public-footer {
    background: #FFFFFF;
    border-top: 1px solid var(--border);
}

[data-theme="light"] .hero-title {
    color: #0F172A;
}

[data-theme="light"] .search-ticket-box {
    border: 1px solid var(--border);
}

[data-theme="light"] .feature-card {
    border: 1px solid var(--border);
}

[data-theme="light"] .form-section {
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .upload-area {
    border-color: #CBD5E1;
    background: #F8FAFC;
}

[data-theme="light"] .badge {
    font-weight: 600;
}

[data-theme="light"] .user-dropdown-menu {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border);
}

/* =================================
   SETTINGS SUB-NAVIGATION LAYOUT
   ================================= */

.settings-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
}

.settings-subnav {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 8px;
    position: sticky;
    top: 20px;
}

.settings-subnav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.settings-subnav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-subnav-link.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.settings-subnav-link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.settings-content {
    min-width: 0;
}

@media (max-width: 768px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-subnav {
        position: static;
        display: flex;
        overflow-x: auto;
        gap: 4px;
    }

    .settings-subnav-link {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* =================================
   ADMIN FOOTER
   ================================= */

.admin-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

.admin-footer-copyright {
    opacity: 0.8;
}

.admin-footer-version {
    font-family: 'Inter', monospace;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-hover);
    padding: 3px 10px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    letter-spacing: 0.3px;
}

/* =================================
   VERSION INFO CARD
   ================================= */

.version-info-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 0;
    margin-top: 16px;
}

.version-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.version-info-row:last-child {
    border-bottom: none;
}

.version-info-label {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.version-info-label i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}

.version-info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Inter', monospace;
}

/* =================================
   SIDEBAR LOGOUT BUTTON
   ================================= */

.sidebar-logout-btn {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

/* =================================
   LIGHT THEME: NEW ELEMENTS
   ================================= */

[data-theme="light"] .admin-footer {
    background: #FFFFFF;
    border-top: 1px solid var(--border);
}

[data-theme="light"] .settings-subnav {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .settings-subnav-link.active {
    background: var(--accent-light);
}

[data-theme="light"] .version-info-card {
    background: #F8FAFC;
}

[data-theme="light"] .admin-footer-version {
    background: #F1F5F9;
}

/* =================================
   NOTIFICATION BELL & POPUP
   ================================= */

.notif-dropdown {
    position: relative;
}

.topbar-notification {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.topbar-notification:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.notif-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    display: none;
}

.notif-dropdown.open .notif-popup {
    display: block;
    animation: dropdownFade 0.15s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notif-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.notif-popup-header a {
    color: var(--accent);
    text-decoration: none;
}

.notif-popup-body {
    max-height: 300px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.notif-item:hover {
    background: var(--bg-hover);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.notif-item-info {
    min-width: 0;
    flex: 1;
}

.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

.notif-item-desc {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.notif-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* =================================
   FILE PREVIEW & LIGHTBOX
   ================================= */

.attachment-preview-card {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-input);
}

.attachment-image-wrap {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
}

.attachment-image-wrap img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.attachment-image-wrap:hover img {
    transform: scale(1.02);
}

.attachment-image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.attachment-image-wrap:hover .attachment-image-overlay {
    opacity: 1;
}

.attachment-pdf-wrap {
    border-bottom: 1px solid var(--border);
}

.attachment-pdf-wrap embed {
    display: block;
}

.attachment-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    gap: 12px;
}

.attachment-info-row>div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.attachment-info-row>div>span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Lightbox Modal */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* =================================
   LOADING OVERLAY ANIMATION
   ================================= */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 17, 32, 0.92);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.loading-spinner svg {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.loading-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 6;
}

.loading-progress {
    fill: none;
    stroke: var(--accent, #3B82F6);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.15s ease;
    filter: drop-shadow(0 0 8px var(--accent-glow, rgba(59, 130, 246, 0.4)));
}

.loading-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    font-family: 'Inter', sans-serif;
}

.loading-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

/* =================================
   RESPONSIVE FIXES
   ================================= */

.table-wrapper {
    overflow-x: auto;
    max-width: 100%;
}

.ticket-detail-grid {
    min-width: 0;
}

.ticket-detail-grid>div {
    min-width: 0;
}

/* =================================
   LIGHT THEME: PHASE 8 OVERRIDES
   ================================= */

[data-theme="light"] .loading-overlay {
    background: rgba(248, 250, 252, 0.95);
}

[data-theme="light"] .loading-percent {
    color: var(--text-primary);
}

[data-theme="light"] .loading-text {
    color: var(--text-secondary);
}

[data-theme="light"] .loading-track {
    stroke: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .notif-popup {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .attachment-preview-card {
    background: #F8FAFC;
}

/* ---- Admin Sidebar Minimize Extension ---- */
.sidebar.minimized {
    width: 70px;
}

.sidebar.minimized .sidebar-header {
    justify-content: center;
    padding: 20px 0;
}

.sidebar.minimized .sidebar-toggle-wrapper {
    justify-content: center !important;
    padding: 14px 0 0 !important;
}

.sidebar.minimized .sidebar-toggle-btn {
    justify-content: center;
    width: 26px !important;
    margin: 0 auto;
}

.sidebar.minimized .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

.sidebar.minimized .sidebar-brand,
.sidebar.minimized .sidebar-version {
    display: none;
}

.sidebar.minimized .sidebar-section-title {
    display: none;
}

.sidebar.minimized .sidebar-link .link-text {
    display: none;
}

.sidebar.minimized .sidebar-link {
    padding: 12px 0;
    justify-content: center;
}

.sidebar.minimized .sidebar-link i {
    margin-right: 0;
    font-size: 20px;
}

.sidebar.minimized~.admin-main {
    margin-left: 70px;
}

[data-theme="light"] .sidebar.minimized~.admin-main {
    margin-left: 70px;
}

/* =================================
   RESPONSIVE LAYOUT
   ================================= */
@media (max-width: 992px) {
    .home-layout {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 16px 0;
    }

    .hero-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .home-layout {
        min-height: auto;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .form-section {
        padding: 20px;
    }
}

/* =================================
   POP UP NOTIFICATION BANNER
   ================================= */

.popup-notification-banner {
    width: 100%;
    background: linear-gradient(90deg, var(--accent, #3B82F6), #7C3AED);
    color: #fff;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    height: 36px;
    flex-shrink: 0;
}

.popup-notification-icon {
    padding: 0 14px;
    font-size: 14px;
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.15);
    height: 100%;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.popup-notification-marquee {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.popup-notification-marquee span {
    display: inline-block;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    animation: popupMarquee var(--marquee-speed, 20s) linear infinite;
    will-change: transform;
}

@keyframes popupMarquee {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}