:root {
    --bg-main: #0B0F19;
    --bg-card: rgba(22, 30, 49, 0.7);
    --bg-card-hover: rgba(30, 42, 69, 0.85);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(59, 130, 246, 0.5);

    --primary: #3B82F6;
    --primary-gradient: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%);
    --accent: #10B981;
    --accent-gradient: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --warning: #F59E0B;
    --danger: #EF4444;

    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

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

/* Background Glow Effects */
.background-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}
.glow-1 {
    width: 500px;
    height: 500px;
    background: rgba(59, 130, 246, 0.15);
    top: -100px;
    left: -100px;
}
.glow-2 {
    width: 600px;
    height: 600px;
    background: rgba(99, 102, 241, 0.12);
    bottom: -150px;
    right: -150px;
}

.app-container {
    position: relative;
    z-index: 1;
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

/* Header Navbar */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.brand-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #FFF;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}
.brand-text h1 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(180deg, #FFFFFF 0%, #D1D5DB 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.version-tag {
    font-size: 12px;
    color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Time Widget */
.time-widget {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    gap: 16px;
}
.time-item {
    display: flex;
    flex-direction: column;
}
.time-item .label {
    font-size: 11px;
    color: var(--text-muted);
}
.time-item .value {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    color: #FFF;
}
.time-item .value.countdown {
    color: var(--primary);
}
.time-divider {
    width: 1px;
    height: 28px;
    background: var(--border-color);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.btn-primary {
    background: var(--primary-gradient);
    color: #FFF;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}
.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}
.btn-icon:hover {
    color: #FFF;
    background: rgba(255, 255, 255, 0.1);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.icon-tasks { background: rgba(59, 130, 246, 0.15); color: #3B82F6; }
.icon-active { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.icon-cron { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.icon-db { background: rgba(139, 92, 246, 0.15); color: #8B5CF6; }

.stat-info {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}
.stat-value {
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-display);
    color: #FFF;
}
.stat-value.highlight { color: #F59E0B; font-size: 16px; }

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Task Cards Grid */
.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.task-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}
.task-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
}
.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.task-user-info h3 {
    font-size: 18px;
    font-weight: 700;
    color: #FFF;
    display: flex;
    align-items: center;
    gap: 8px;
}
.task-user-info .sub-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Switch Slider */
.switch-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.switch-label input { display: none; }
.slider {
    width: 44px;
    height: 22px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
}
.slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFF;
    top: 3px;
    left: 3px;
    transition: 0.3s;
}
.switch-label input:checked + .slider {
    background: var(--accent);
}
.switch-label input:checked + .slider::before {
    transform: translateX(22px);
}

/* Key Detail Items */
.task-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    padding: 12px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}
.detail-row span.val {
    color: #E5E7EB;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Task Status Tag */
.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}
.status-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.status-badge.success { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.status-badge.waiting { background: rgba(59, 130, 246, 0.15); color: #3B82F6; }
.status-badge.error { background: rgba(239, 68, 68, 0.15); color: #EF4444; }

.task-actions {
    display: flex;
    gap: 6px;
}

/* Console Box */
.console-box {
    height: 220px;
    padding: 16px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.log-item {
    display: flex;
    gap: 12px;
    line-height: 1.5;
}
.log-time { color: var(--text-muted); }
.log-item.INFO .log-msg { color: #60A5FA; }
.log-item.SUCCESS .log-msg { color: #34D399; font-weight: 600; }
.log-item.WARN .log-msg { color: #FBBF24; }
.log-item.ERROR .log-msg { color: #F87171; }
.log-item.SYSTEM .log-msg { color: #A78BFA; }

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    width: 100%;
    max-width: 620px;
    padding: 28px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 {
    font-size: 20px;
}
.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}
.btn-close:hover { color: #FFF; }

.form-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin: 16px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.form-row {
    display: grid;
    gap: 14px;
    margin-bottom: 12px;
}
.form-row.col-2 {
    grid-template-columns: 1fr 1fr;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.form-group input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 8px;
    color: #FFF;
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}
.form-hint {
    font-size: 11px;
    color: var(--text-muted);
}
.check-group {
    margin-top: 14px;
}
.switch-text {
    font-size: 13px;
    color: var(--text-main);
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

@media (max-width: 768px) {
    .app-header { flex-direction: column; align-items: flex-start; }
    .header-right { width: 100%; justify-content: space-between; }
    .form-row.col-2 { grid-template-columns: 1fr; }
}
