:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-hover: #30363d;
    --border-color: #30363d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-yellow: #d29922;
    --accent-red: #f85149;
    --accent-purple: #a371f7;
    --accent-cyan: #39d0d8;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 6px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Audit Banner */
.audit-banner {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: white;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
}

.audit-banner i {
    font-size: 16px;
}

.audit-banner strong {
    font-weight: 600;
}

/* App Container */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.logo i {
    color: var(--accent-cyan);
    font-size: 18px;
}

.nav-tabs {
    display: flex;
    gap: 4px;
}

.nav-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-tab.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.notification-badge {
    background: var(--accent-red);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

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

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-box input {
    padding: 8px 12px 8px 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    width: 200px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-blue);
    width: 260px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: var(--text-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.btn-secondary {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    position: relative;
}

.btn-icon:hover {
    background: var(--bg-hover);
}

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

.btn-block {
    width: 100%;
}

.text-danger {
    color: var(--accent-red);
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.user-menu-btn:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.user-name {
    font-weight: 500;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    min-width: 180px;
    box-shadow: var(--shadow);
    z-index: 100;
    padding: 8px 0;
}

.dropdown-section {
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-section:last-child {
    border-bottom: none;
}

.dropdown-label {
    padding: 8px 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

.dropdown-item i {
    width: 16px;
    color: var(--text-secondary);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.filter-group select {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

.stats {
    margin-left: auto;
    display: flex;
    gap: 20px;
}

.stat {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-number {
    font-weight: 600;
    color: var(--text-primary);
}

.stat-number.overdue {
    color: var(--accent-red);
}

/* Board */
.board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    padding: 24px;
    flex: 1;
    overflow-x: auto;
    min-width: 1200px;
}

.column {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-width: 280px;
    max-height: 100%;
}

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

.column-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.column-header h3 i {
    font-size: 12px;
    opacity: 0.7;
}

.column-header .count {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.column-content {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Task Cards */
.task-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: grab;
    transition: all 0.2s;
    position: relative;
}

.task-card:hover {
    border-color: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.task-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.task-card.p0 { border-left: 3px solid var(--accent-red); }
.task-card.p1 { border-left: 3px solid var(--accent-yellow); }
.task-card.p2 { border-left: 3px solid var(--accent-blue); }

.task-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.task-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
    margin-right: 8px;
}

.task-menu {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    font-size: 14px;
}

.task-menu:hover {
    color: var(--text-primary);
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.task-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.task-tag.priority-p0 { background: rgba(248, 81, 73, 0.15); color: var(--accent-red); }
.task-tag.priority-p1 { background: rgba(210, 153, 34, 0.15); color: var(--accent-yellow); }

.task-assignee {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    margin-left: auto;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: white;
}

.task-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.task-date.overdue {
    color: var(--accent-red);
}

/* Projects View */
.projects-view,
.cron-view,
.notifications-view {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.projects-header,
.cron-header,
.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.projects-header h2,
.cron-header h2,
.notifications-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.cron-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.2s;
    border-left: 4px solid var(--accent-blue);
}

.project-card:hover {
    border-color: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.project-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.project-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-card > p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.project-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.project-stats strong {
    color: var(--text-primary);
}

.project-members {
    display: flex;
    gap: -8px;
}

.member-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    border: 2px solid var(--bg-secondary);
    margin-left: -8px;
}

.member-avatar:first-child {
    margin-left: 0;
}

/* Cron Jobs View */
.cron-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cron-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
}

.cron-item:hover {
    border-color: var(--bg-hover);
}

.cron-status {
    flex-shrink: 0;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
}

.status-dot.active {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(63, 185, 80, 0.4);
}

.status-dot.inactive {
    background: var(--text-muted);
}

.cron-info {
    flex: 1;
    min-width: 0;
}

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

.cron-info > p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.cron-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
}

.cron-project {
    font-weight: 500;
}

.cron-schedule {
    color: var(--text-muted);
}

.cron-stats {
    display: flex;
    gap: 24px;
    flex-shrink: 0;
}

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

.cron-stat label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.cron-stat span {
    font-size: 13px;
    font-weight: 500;
}

/* Notifications View */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: all 0.2s;
}

.notification-item:hover {
    background: var(--bg-tertiary);
}

.notification-item.unread {
    border-left: 3px solid var(--accent-blue);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon i {
    color: var(--accent-blue);
    font-size: 14px;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

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

.notification-from {
    font-weight: 600;
    font-size: 14px;
}

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

.notification-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.notification-project {
    font-size: 12px;
    font-weight: 500;
}

.notification-unread {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-blue);
    flex-shrink: 0;
    margin-top: 4px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

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

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 24px 24px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-divider {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

/* Profile Modal */
.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: white;
}

/* Audit Modal */
.audit-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 1200px) {
    .board {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .header-left {
        gap: 16px;
    }
    
    .nav-tabs {
        order: 3;
        width: 100%;
    }
    
    .filters-bar {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .board {
        grid-template-columns: 1fr;
        min-width: auto;
    }
    
    .column {
        min-width: auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cron-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cron-stats {
        width: 100%;
        justify-content: flex-start;
    }
}
