:root {
    --bg-dark: #04090d;
    --panel-bg: rgba(6, 18, 22, 0.7);
    --panel-border: rgba(20, 184, 166, 0.15);
    --panel-hover: rgba(20, 184, 166, 0.25);
    
    --text-primary: #f0fdfa;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #14b8a6;
    --primary-hover: #2dd4bf;
    --secondary: #0ea5e9;
    --secondary-hover: #38bdf8;
    
    --success: #10b981;
    --danger: #f43f5e;
    --warning: #f59e0b;
    --gold: #f59e0b;
    --info: #06b6d4;
    
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Glowing Background Circles */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(20, 184, 166, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(14, 165, 233, 0.08) 0%, transparent 45%);
    z-index: -1;
    pointer-events: none;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(20, 184, 166, 0.25);
}

/* Main Container Layout */
.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 100vh;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 28px;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(20, 184, 166, 0.5);
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo .subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
    margin-top: 1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.character-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Custom Select */
.custom-select {
    background: rgba(8, 20, 26, 0.85);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    outline: none;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s;
}

.custom-select:hover, .custom-select:focus {
    border-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: #04090d;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 15px rgba(20, 184, 166, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--panel-border);
    color: var(--text-primary);
}

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

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.3);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon-danger {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon-danger:hover {
    color: var(--danger);
    background: rgba(244, 63, 94, 0.1);
}

/* Navigation */
.top-navbar {
    padding: 5px;
}

.top-navbar ul {
    display: flex;
    list-style: none;
    gap: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(20, 184, 166, 0.05);
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(20, 184, 166, 0.15);
    border: 1px solid rgba(20, 184, 166, 0.25);
}

.nav-icon {
    font-size: 16px;
}

/* Layouts */
.main-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.content-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Filter/Control Bars */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group input {
    background: rgba(8, 20, 26, 0.85);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    outline: none;
    font-family: var(--font-main);
    transition: all 0.3s;
}

.filter-group input:hover, .filter-group input:focus {
    border-color: var(--primary);
}

/* Grids & Cards */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.status-card {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.status-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-card-icon {
    font-size: 20px;
    color: var(--primary);
}

.status-card-value {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
}

.status-card-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Alert Banner */
.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 14px;
}

.alert-item.danger {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: #fda4af;
}

.alert-item.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fde047;
}

.alert-item.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
}

/* Tables */
.table-container {
    padding: 10px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    text-align: left;
    padding: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--panel-border);
}

td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

tr:hover td {
    background: rgba(20, 184, 166, 0.02);
}

/* Badge classes */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

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

/* Login Panel */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    max-width: 500px;
    width: 100%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.login-logo-icon {
    font-size: 60px;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(20, 184, 166, 0.6);
}

.login-card h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
}

.desc-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.btn-eve {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #111;
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--panel-border);
    transition: all 0.3s;
}

.btn-eve:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(20, 184, 166, 0.2);
}

.btn-eve img {
    height: 24px;
}

.login-footer {
    margin-top: 15px;
    font-size: 11px;
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.bold {
    font-weight: 600;
}

/* Setup Config Grid for Planner */
.setup-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

@media(max-width: 900px) {
    .setup-grid {
        grid-template-columns: 1fr;
    }
}

.allocation-card {
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary);
}

.allocation-card.factory {
    border-left-color: var(--secondary);
}

.system-tag {
    font-size: 11px;
    background: rgba(255,255,255,0.05);
    padding: 3px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

/* Modal Popup Window Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 9, 13, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.modal-card {
    max-width: 700px;
    width: 90%;
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 15px;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(20, 184, 166, 0.3);
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: var(--danger);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Clickable System Link */
.system-link {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}

.system-link:hover {
    color: var(--primary-hover);
    border-bottom-style: solid;
}
