:root {
    --bg-color: #0F1115;
    --panel-color: #1A1E24;
    --panel-hover: #232830;
    --accent-color: #00E5FF;
    --accent-glow: rgba(0, 229, 255, 0.2);
    --orange-color: #FF9100;
    --purple-color: #7C4DFF;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-dim: rgba(255, 255, 255, 0.3);
    --danger-color: #FF5252;
    --success-color: #69F0AE;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 72px;
    background-color: var(--panel-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
    overflow-y: auto; /* Allow scrolling if menu gets long */
}

/* Hide scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.nav-brand {
    margin-bottom: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand-link {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display:flex;
    align-items:center;
    justify-content:center;
    text-decoration: none;
    background: rgba(0,0,0,0.20);
    border: 1px solid rgba(255,255,255,0.06);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.brand-link:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.03);
    border-color: rgba(0,229,255,0.28);
}

.brand-logo {
    width: 38px;
    height: 38px;
    display:block;
}

.nav-item {
    width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0; /* Prevent shrinking */
}

.nav-item:hover {
    background-color: var(--panel-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.nav-item.active {
    background-color: var(--accent-glow);
    color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

.nav-item .material-icons {
    font-size: 24px;
    margin-bottom: 4px;
}

.nav-item .label {
    font-size: 10px;
    font-weight: 500;
}

/* Submenu Styles */
.submenu-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.submenu {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
    border-radius: 8px;
    padding: 5px 0;
}

.submenu.open {
    display: flex;
    animation: slideDown 0.3s ease-out;
}

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

.submenu .nav-item {
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
    background-color: transparent;
    border: 1px solid rgba(255,255,255,0.05);
}

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

.submenu .nav-item.active {
    background-color: var(--accent-glow);
    border-color: var(--accent-color);
}

.submenu .nav-item .material-icons {
    font-size: 20px;
}

.submenu .nav-item .label {
    font-size: 9px;
}

.nav-spacer {
    flex: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top right, #1a1e24 0%, #0f1115 40%);
}

.top-bar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(16px, 2vw, 30px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 17, 21, 0.55);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.2px;
    margin: 0;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 12px 20px;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 0.9em;
    animation: fadeIn 0.3s ease;
}

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

/* Corporation Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert.info {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

.alert.warning {
    background: rgba(255, 145, 0, 0.1);
    border: 1px solid var(--orange-color);
    color: var(--orange-color);
}

.mt-20 { margin-top: 20px; }

.btn-large {
    padding: 15px 30px;
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.isk-value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
}

.profit { color: var(--success-color); }
.loss { color: var(--danger-color); }

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9em;
}

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

.table-container {
    overflow-x: auto;
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: var(--success-color);
    box-shadow: 0 0 5px var(--success-color);
}

.content-body {
    flex: 1;
    padding: clamp(16px, 2.2vw, 30px);
    overflow-y: auto;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
}

/* Text Utils */
.text-dim { color: var(--text-dim); }
.text-secondary { color: var(--text-secondary); }
.text-right { text-align: right; }

/* Grid & Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background-color: var(--panel-color);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.card-icon.accent { color: var(--accent-color); background: var(--accent-glow); }
.card-icon.orange { color: var(--orange-color); background: rgba(255, 145, 0, 0.1); }
.card-icon.purple { color: var(--purple-color); background: rgba(124, 77, 255, 0.1); }

.card-info h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

.card-info .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.grid-2-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.large-card {
    min-height: 300px;
}

.large-card h2 {
    margin-top: 0;
    font-size: 18px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 15px;
}

.space-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-header-clean {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.card-header-clean h2,
.card-header-clean h3 {
    margin: 0;
    font-weight: 900;
    letter-spacing: 0.2px;
}

.card-header-clean h2 { font-size: 18px; }
.card-header-clean h3 { font-size: 15px; }

.page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(0,229,255,0.10), rgba(124,77,255,0.06));
    border: 1px solid rgba(0, 229, 255, 0.10);
}

.page-hero-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.page-hero-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(0,0,0,0.20);
    display: block;
}

.page-hero-title {
    font-weight: 900;
    letter-spacing: 0.3px;
    line-height: 1.1;
}

.page-hero-subtitle {
    margin-top: 4px;
    color: var(--text-secondary);
}

/* Utils */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    margin: 30px 0;
}

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

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 14px;
    color: var(--text-secondary);
}

.alert-item .material-icons { font-size: 20px; }
.alert-item.high { color: var(--accent-color); }
.alert-item.info { color: var(--text-secondary); }
.alert-item.success { color: var(--success-color); }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--panel-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--panel-hover);
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th {
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
}

.data-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Glass Panels */
.glass-panel {
    background: rgba(26, 30, 36, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    margin-bottom: 20px;
}

.glass-panel-secondary {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-size: 14px;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.18);
}

.btn[disabled], .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.btn-primary:hover {
    background: #40EFFF;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
}

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

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

.btn-danger {
    background: rgba(255, 82, 82, 0.2);
    color: var(--danger-color);
}

.btn-danger:hover {
    background: rgba(255, 82, 82, 0.4);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 800;
    border: 1px solid rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.78);
    background: rgba(255,255,255,0.04);
    letter-spacing: 0.3px;
}

.badge-bounties { background: rgba(76, 175, 80, 0.14); color: #4caf50; border-color: rgba(76, 175, 80, 0.22); }
.badge-market { background: rgba(33, 150, 243, 0.14); color: #2196f3; border-color: rgba(33, 150, 243, 0.22); }
.badge-industry { background: rgba(255, 152, 0, 0.14); color: #ff9800; border-color: rgba(255, 152, 0, 0.22); }
.badge-donations { background: rgba(156, 39, 176, 0.14); color: #ce93d8; border-color: rgba(156, 39, 176, 0.22); }
.badge-others { background: rgba(255, 255, 255, 0.05); color: rgba(255,255,255,0.60); border-color: rgba(255,255,255,0.10); }

.positive { color: #4caf50; }
.negative { color: #f44336; }

.btn-refresh {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.75);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
}

.btn-refresh:hover {
    border-color: rgba(0,229,255,0.35);
    color: rgba(0,229,255,0.95);
}

.section-kpis,
.coverage-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.section-kpi,
.coverage-kpi {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.section-kpi-label,
.coverage-kpi-label {
    color: var(--text-dim);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-kpi-value,
.coverage-kpi-value {
    font-weight: 900;
    font-family: 'Roboto Mono', monospace;
}

.form-group label {
    display: block;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.ticket-form .form-group + .form-group {
    margin-top: 12px;
}

.js-reveal {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 260ms ease, transform 260ms ease;
}

.js-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Forms */
.form-control {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.30);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.search-input:focus {
    border-color: rgba(0, 229, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.10);
}

select.search-input {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.35) 50%), linear-gradient(135deg, rgba(255,255,255,0.35) 50%, transparent 50%);
    background-position: calc(100% - 16px) calc(50% + 1px), calc(100% - 11px) calc(50% + 1px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 30px;
}

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

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
}

.modern-table thead th {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.28);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: none;
    font-size: 12px;
    letter-spacing: 0.2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modern-table th,
.modern-table td {
    padding: 12px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

.modern-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.isk-text {
    font-variant-numeric: tabular-nums;
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 320px;
    background: var(--panel-color);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    transition: transform 0.3s ease;
}

.chat-widget.collapsed {
    transform: translateY(calc(100% - 40px));
}

.chat-header-bar {
    padding: 12px 15px;
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-color);
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px 12px 0 0;
}

.chat-header-bar:hover {
    background: rgba(0, 229, 255, 0.2);
}

.chat-body {
    height: 350px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-size: 13px;
    background: rgba(0,0,0,0.2);
}

.chat-msg {
    margin-bottom: 6px;
    line-height: 1.4;
}

.chat-msg .time { color: var(--text-dim); font-size: 11px; }
.chat-msg .user { color: var(--accent-color); font-weight: bold; }
.chat-msg .text { color: var(--text-secondary); }

.chat-input-row {
    padding: 10px;
    display: flex;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input-row input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: white;
    padding: 6px 10px;
}

.chat-input-row button {
    background: var(--accent-color);
    border: none;
    border-radius: 4px;
    color: black;
    cursor: pointer;
    width: 32px;
}
