/* SRE Console Custom Stylesheet */
:root {
    --bg-dark: #060913;
    --bg-main: #090e1a;
    --bg-panel: rgba(13, 18, 33, 0.75);
    --bg-panel-solid: #0d1221;
    --bg-card: rgba(18, 25, 46, 0.65);
    --bg-card-hover: rgba(23, 32, 59, 0.85);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6, #6366f1);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --purple: #8b5cf6;
    
    --font-sans: 'Outfit', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Global ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body::before {
    content: '';
    position: fixed;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(ellipse at 15% 15%, rgba(59, 130, 246, 0.06) 0%, transparent 55%),
                radial-gradient(ellipse at 85% 85%, rgba(139, 92, 246, 0.05) 0%, transparent 55%),
                radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.02) 0%, transparent 60%);
    animation: drift 40s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(40px, -20px) rotate(1deg); }
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    filter: brightness(1.2);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── App Layout ── */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background-color: var(--bg-panel-solid);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 10;
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    font-size: 24px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.status-indicator.online .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.sidebar-nav {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
    text-align: left;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--primary);
    background-color: rgba(59, 130, 246, 0.1);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background-color: var(--primary);
    border-radius: 0 4px 4px 0;
}

.badge-alert-count {
    background-color: var(--error);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.btn-logout {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-logout:hover {
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.content-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(6, 9, 19, 0.4);
}

.content-header h1 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #f8fafc, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.uptime-widget {
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
    font-family: var(--font-mono);
}

.uptime-widget .label {
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 4px;
}

/* ── Tab Panels ── */
.tab-panel {
    display: none;
    padding: 32px;
    flex: 1;
}

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

/* ── Login View ── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #040710;
    position: relative;
}

.login-card {
    background: var(--bg-panel);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: white;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.login-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.input-group {
    margin-bottom: 24px;
}

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-sans);
    outline: none;
    transition: var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

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

.error-msg {
    color: var(--error);
    font-size: 13px;
    text-align: center;
    margin-top: 16px;
    min-height: 20px;
}

/* ── Dashboard Tab ── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

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

.metric-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-title i {
    color: var(--primary);
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
}

.metric-progress-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.metric-progress-fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-footer {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.net-speeds {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 11px;
    font-family: var(--font-mono);
}

.net-speeds span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.net-up { color: var(--purple); }
.net-down { color: var(--primary); }

.metric-chart-container {
    height: 20px;
    margin: 4px 0 12px 0;
}

/* Dashboard Details Layout */
.dashboard-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.details-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
}

.details-panel h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-wrapper {
    height: 300px;
    position: relative;
}

.active-alerts-card {
    display: flex;
    flex-direction: column;
    max-height: 380px;
}

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

.view-all-alerts {
    font-size: 12px;
    font-weight: 500;
}

.active-alerts-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: var(--text-muted);
    gap: 12px;
}

.alert-empty-state i {
    font-size: 32px;
}

.alert-empty-state span {
    font-size: 13px;
}

.active-alert-item {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    animation: slideIn 0.3s ease;
}

.active-alert-item.firing {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

.active-alert-item.firing i {
    color: var(--error);
    margin-top: 2px;
}

.alert-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-info p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.alert-time {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ── Compose Tab ── */
.action-bar {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.bar-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.compose-groups {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.compose-group-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.group-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
    transition: var(--transition);
}

.service-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.service-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.status-dot-large {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
    position: relative;
}

.status-dot-large.running {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot-large.running::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid rgba(16, 185, 129, 0.4);
    animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6); opacity: 0; }
}

.status-dot-large.stopped {
    background-color: var(--text-muted);
}

.status-dot-large.error {
    background-color: var(--error);
    box-shadow: 0 0 8px var(--error);
}

.service-details h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.service-details p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.service-status-text {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    margin-top: 4px;
}

.service-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    margin-top: 12px;
}

.autostart-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    transition: .3s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(16px);
    background-color: var(--primary);
}

.autostart-label {
    font-size: 12px;
    color: var(--text-muted);
}

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

/* ── Logs Tab ── */
.logs-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    height: calc(100vh - 140px);
}

.logs-sidebar {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 14px;
    font-family: var(--font-sans);
    outline: none;
    width: 100%;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

select.form-control option {
    background-color: var(--bg-panel-solid);
    color: var(--text-primary);
}

.search-input-wrapper {
    display: flex;
    gap: 6px;
}

.search-input-wrapper input {
    flex: 1;
}

.stream-control {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 0;
}

.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
}

.toggle-switch-wrapper .toggle-label {
    font-size: 13px;
    font-weight: 500;
}

.logs-terminal {
    background-color: #03050a;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terminal-header {
    background: #090e1a;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.terminal-dots .dot.red { background-color: var(--error); }
.terminal-dots .dot.yellow { background-color: var(--warning); }
.terminal-dots .dot.green { background-color: var(--success); }

.terminal-title {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-weight: 500;
}

.terminal-status {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot-static {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-dot-static.stopped { background-color: var(--text-muted); }
.status-dot-static.running {
    background-color: var(--success);
    box-shadow: 0 0 6px var(--success);
    animation: flash 1s infinite alternate;
}

@keyframes flash {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

.terminal-body {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.6;
    color: #94a3b8;
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-line {
    margin-bottom: 4px;
}

.terminal-line.system {
    color: var(--primary);
    font-weight: 500;
}

.terminal-line.err {
    color: var(--error);
}

/* ── Alerts Tab ── */
.alerts-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.alerts-main {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.alerts-section {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
}

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

.alert-rules-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.alert-rules-table th {
    text-align: left;
    padding: 12px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.alert-rules-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-color);
}

.alert-rules-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.alert-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 4px;
}

.alert-history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-history-item.firing {
    border-left: 3px solid var(--error);
}

.alert-history-item.resolved {
    border-left: 3px solid var(--success);
}

.history-icon.firing { color: var(--error); }
.history-icon.resolved { color: var(--success); }

.history-info {
    flex: 1;
}

.history-info h4 {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 2px;
}

.history-info p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.history-meta {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

.alerts-sidebar .sidebar-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
}

.alerts-sidebar h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ── UI Buttons ── */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-icon-only {
    width: 38px;
    height: 38px;
    padding: 0;
}

.btn-success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    color: var(--success);
}
.btn-success:hover {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--success);
}

.btn-error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--error);
}
.btn-error:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--error);
}

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

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    top: 50%; left: 50%;
    margin-top: -7px;
    margin-left: -7px;
    border: 2px solid var(--text-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Modals & Dialogs ── */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.25s ease;
}

.confirm-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.confirm-dialog {
    background: var(--bg-panel-solid);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: scaleUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.confirm-dialog h3 {
    font-size: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--warning);
}

.confirm-dialog p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ── Toast Messages ── */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(13, 18, 33, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 13.5px;
    color: var(--text-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 360px;
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: var(--transition);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast.warning { border-left: 4px solid var(--warning); }

@keyframes toastSlideIn {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.fade-out {
    transform: translateX(100px);
    opacity: 0;
}

/* ── Responsive Layouts ── */
@media (max-width: 1024px) {
    .dashboard-details {
        grid-template-columns: 1fr;
    }
    .alerts-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
    }
    
    .nav-item {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .nav-item.active::before {
        bottom: 0;
        top: auto;
        left: 20%;
        width: 60%;
        height: 3px;
        border-radius: 4px 4px 0 0;
    }
    
    .main-content {
        height: auto;
    }
    
    .logs-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .logs-sidebar {
        height: auto;
    }
    
    .logs-terminal {
        height: 400px;
    }
    
    .content-header {
        padding: 16px 24px;
    }
    
    .tab-panel {
        padding: 20px;
    }
}
