/* Font-Face Definitions */
@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-v20-latin-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-v20-latin-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-v20-latin-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/inter-v20-latin-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans';
    src: url('fonts/dm-sans-v17-latin-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans';
    src: url('fonts/dm-sans-v17-latin-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans';
    src: url('fonts/dm-sans-v17-latin-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans';
    src: url('fonts/dm-sans-v17-latin-800.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Brand Colors */
    --brand-dark: #201c21;
    --brand-white: #ffffff;
    --brand-light-blue: #42b7f9;
    --brand-dark-blue: #191c6c;
    --brand-blue: #1246f4;
    
    /* Color Scheme - Brand Guidelines */
    --bg-primary: #201c21;
    --bg-secondary: #191c6c;
    --bg-tertiary: #191c6c;
    --accent-blue: #42b7f9;
    --accent-sky: #1246f4;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --priority-1: #ff4444;
    --priority-2: #ffaa00;
    --priority-3: #44ff44;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --error: #f44336;
    --border: rgba(66, 183, 249, 0.3);
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.app-container {
    width: 100%;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.app-header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-sky));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-logo {
    height: 64px;
    width: auto;
    object-fit: contain;
    -webkit-text-fill-color: initial;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.user-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.user-display #currentUserName {
    color: var(--text-primary);
    font-weight: 500;
    min-width: 100px;
    text-align: right;
}

.user-display .btn-secondary {
    padding: 6px 12px;
    font-size: 12px;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: var(--accent-blue);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--accent-sky);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-blue);
}

/* Time Tracking Display */
.time-tracking-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 12px 20px;
    margin: 10px 0;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 2px solid var(--accent-blue);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

.time-tracking-label {
    font-weight: 600;
    color: var(--text-primary);
}

.time-tracking-task-name {
    font-weight: 700;
    color: var(--accent-blue);
    font-size: 16px;
}

.time-tracking-time {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-sky);
    min-width: 80px;
    text-align: center;
    background: var(--bg-primary);
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.stop-tracking-btn {
    padding: 6px 16px;
    font-size: 13px;
    background: var(--danger);
    color: white;
    border: none;
}

.stop-tracking-btn:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

.time-tracking-btn {
    background: var(--accent-blue);
    color: var(--bg-primary);
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.time-tracking-btn:hover {
    background: var(--accent-sky);
    transform: translateY(-1px);
}

.task-item[data-tracking-active="true"] {
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

/* Wochenplaner Hintergrund */
#planner.tab-content {
    background: #201c21;
    padding: 20px;
    border-radius: 12px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dispatcher View */
.dispatcher-layout {
    display: flex;
    gap: 20px;
    position: relative;
    width: 100%;
    height: calc(100vh - 200px);
}

.dispatcher-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

.dispatcher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
}

.dispatcher-header h2 {
    flex: 0 0 auto;
}

.email-drop-zone {
    padding: 15px 25px;
    border: 2px dashed var(--accent-blue);
    border-radius: 8px;
    background-color: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 250px;
    flex-shrink: 0;
    margin-right: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.email-drop-zone:hover {
    border-color: var(--accent-sky);
    background-color: var(--bg-tertiary);
    border-style: solid;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.email-drop-zone.drag-over {
    border-color: var(--accent-blue);
    background-color: var(--bg-tertiary);
    border-style: solid;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    transform: scale(1.05);
}

.drop-zone-text {
    color: var(--accent-blue);
    font-size: 15px;
    display: block;
    font-weight: 500;
}

.email-drop-zone.drag-over .drop-zone-text {
    color: var(--accent-sky);
    font-weight: bold;
}

.task-ical-dropzone {
    padding: 12px 20px;
    border: 2px dashed var(--accent-blue);
    border-radius: 6px;
    background-color: var(--bg-secondary);
    cursor: copy;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 140px;
    color: var(--accent-blue);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Hide the default drag cursor by using custom cursor */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%2300d4ff" d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/></svg>') 12 12, copy;
}

.task-ical-dropzone:hover {
    border-color: var(--accent-sky);
    background-color: var(--bg-tertiary);
    border-style: solid;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.task-ical-dropzone.drag-over {
    border-color: var(--accent-blue);
    background-color: var(--bg-tertiary);
    border-style: solid;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    transform: scale(1.05);
    color: var(--accent-sky);
    font-weight: bold;
    /* Override cursor when dragging over */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%2300d4ff" d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/></svg>') 12 12, copy !important;
}

/* Planner Sidebar */
.planner-sidebar {
    flex: 2;
    min-width: 0;
    background: #201c21;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    overflow-x: auto;
    transition: all 0.3s;
}

.planner-sidebar.collapsed {
    display: none;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--accent-blue);
}

.sidebar-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s;
}

.sidebar-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.week-navigation-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.weeks-container-sidebar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    overflow-x: auto;
    background: #201c21;
    padding: 15px;
    border-radius: 8px;
}

.week-section-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.week-header-sidebar {
    background: var(--bg-tertiary);
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: var(--accent-blue);
    border: 2px solid var(--border);
}

.week-grid-sidebar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.day-column-sidebar {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 10px;
    border: 1px solid var(--border);
}

.day-column-sidebar h4 {
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    visibility: visible;
    opacity: 1;
}

.day-column-sidebar h4:hover {
    color: var(--accent-blue);
}

.day-slots-sidebar {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border: 2px dashed transparent;
    border-radius: 4px;
    padding: 5px;
    transition: all 0.3s;
}

.day-slots-sidebar.drag-over {
    border-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.1);
}

.slot-item-sidebar {
    background: var(--bg-secondary);
    border-radius: 4px;
    padding: 6px;
    cursor: move;
    border-left: 3px solid;
    font-size: 11px;
    transition: all 0.3s;
}

.slot-item-sidebar:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 6px var(--shadow);
}

.slot-item-sidebar.dragging {
    opacity: 0.5;
}

.slot-header-sidebar {
    font-weight: 600;
    font-size: 11px;
    margin-bottom: 2px;
}

.slot-meta-sidebar {
    font-size: 10px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.urgency-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.capacity-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hours-badge {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-weight: bold;
}

.hours-badge.low {
    background: var(--danger);
    animation: pulse 2s infinite;
}

.hours-badge.warning {
    background: var(--warning);
}

.urgency-suggest {
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
}

.filter-search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.filter-search-input {
    flex: 1;
    padding: 10px 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s;
}

.filter-search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.filter-search-input::placeholder {
    color: var(--text-secondary);
}

/* Tags */
.tags-container {
    margin-top: 10px;
}

.tag-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 10px;
}

.tag-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.tag-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-select:hover {
    border-color: var(--accent-blue);
}

.tag-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 30px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary);
}

.tag-chip .tag-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.tag-chip .tag-remove:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-list.drag-over {
    border: 2px dashed var(--accent-blue);
    border-radius: 8px;
    padding: 10px;
    background: rgba(0, 212, 255, 0.05);
}

.task-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    cursor: move;
    transition: all 0.3s;
    position: relative;
}

.task-item:hover {
    border-color: var(--accent-blue);
    transform: translateX(5px);
    box-shadow: 0 4px 12px var(--shadow);
}

.task-item.priority-1 {
    border-left: 4px solid var(--priority-1);
}

.task-item.priority-2 {
    border-left: 4px solid var(--priority-2);
}

.task-item.priority-3 {
    border-left: 4px solid var(--priority-3);
}

.task-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.task-name {
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}

.task-name:hover {
    color: var(--accent-blue);
}

.task-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.task-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.badge-priority {
    background: var(--bg-tertiary);
}

.badge-risk {
    background: var(--warning);
    color: var(--bg-primary);
}

.badge-deadline {
    background: var(--danger);
    animation: pulse 2s infinite;
}

.badge-schedule {
    background: var(--accent-blue);
    color: var(--bg-primary);
    font-weight: 600;
}

.badge-stage {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.badge-blocked {
    background: var(--danger);
    color: white;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.task-blocked {
    border: 2px solid var(--danger);
    opacity: 0.9;
}

.slot-blocked {
    border-left-width: 6px;
    border-left-color: var(--danger) !important;
    background: rgba(244, 67, 54, 0.1);
}

.task-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
    cursor: pointer;
}

.task-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.task-actions button {
    padding: 4px 8px;
    font-size: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
}

.task-actions button:hover {
    background: var(--accent-blue);
    color: var(--bg-primary);
}

/* Kanban View */
.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.kanban-header select {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 200px;
}

.kanban-header select:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-blue);
}

.kanban-header select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    min-height: 600px;
}

.kanban-column {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px;
    border: 2px solid var(--border);
}

.kanban-column h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    text-align: center;
}

.kanban-list {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-card {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 12px;
    cursor: move;
    transition: all 0.3s;
    border-left: 4px solid var(--border);
}

.kanban-card.priority-1 {
    border-left-color: var(--priority-1);
}

.kanban-card.priority-2 {
    border-left-color: var(--priority-2);
}

.kanban-card.priority-3 {
    border-left-color: var(--priority-3);
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.kanban-card.dragging {
    opacity: 0.5;
}

/* Wochenplaner */
.planner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.week-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
}

.week-label {
    font-weight: 600;
    font-size: 16px;
}

.capacity-bar-container {
    margin-bottom: 20px;
}

.capacity-bar {
    height: 30px;
    background: var(--bg-tertiary);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--border);
}

.capacity-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s, background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.capacity-fill.warning {
    background: var(--warning);
}

.capacity-fill.danger {
    background: var(--danger);
}

.capacity-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 30px;
    font-weight: bold;
    z-index: 1;
}

.overflow-warning {
    background: var(--danger);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.overflow-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.suggestion-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-actions {
    display: flex;
    gap: 8px;
}

.weeks-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    overflow-x: auto;
    background: #201c21;
    padding: 20px;
    border-radius: 12px;
}

.week-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.week-header {
    background: var(--bg-tertiary);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    color: var(--accent-blue);
    border: 2px solid var(--border);
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.day-column {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px;
    border: 2px solid var(--border);
    display: flex;
    gap: 10px;
    position: relative;
}

.day-capacity-indicator {
    width: 8px;
    min-width: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.day-capacity-fill {
    width: 100%;
    background: var(--success);
    border-radius: 4px;
    transition: height 0.3s;
    min-height: 4px;
}

.day-capacity-fill.warning {
    background: var(--warning);
}

.day-capacity-fill.danger {
    background: var(--danger);
}

.day-capacity-label {
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    font-size: 10px;
    white-space: nowrap;
    color: var(--text-secondary);
    font-weight: 600;
}

.day-column-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.day-column h3 {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    visibility: visible;
    opacity: 1;
}

.day-column h3:hover {
    color: var(--accent-blue);
}

.day-slots {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 2px dashed transparent;
    border-radius: 4px;
    padding: 5px;
    transition: all 0.3s;
}

.day-slots.drag-over {
    border-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.1);
}

.slot-item {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 10px;
    cursor: move;
    border-left: 4px solid;
    transition: all 0.3s;
}

.slot-item:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px var(--shadow);
}

.slot-item.dragging {
    opacity: 0.5;
}

.slot-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.slot-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

/* Dashboard */
.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
}

.project-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px var(--shadow);
}

.project-card h3 {
    margin-bottom: 15px;
    color: var(--accent-blue);
}

.project-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-blue);
    transition: width 0.3s;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #201c21;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 2px solid var(--border);
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--accent-blue);
}

.modal-content label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    color: var(--text-primary);
    font-weight: 500;
}

.modal-content input,
.modal-content textarea,
.modal-content select {
    width: 100%;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
}

.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.form-actions .btn-primary {
    margin-left: auto;
}

.form-actions .close-modal {
    margin-right: auto;
}

.day-detail-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.time-slot {
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border-left: 4px solid var(--accent-blue);
}

.time-slot.free {
    background: var(--bg-primary);
    border-left-color: var(--border);
    color: var(--text-secondary);
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 2000;
    display: none;
    animation: slideIn 0.3s;
}

.toast.show {
    display: block;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Sortable */
.sortable {
    position: relative;
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--accent-blue);
}

/* Responsive */
@media (max-width: 1600px) {
    .weeks-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
    
    .weeks-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }
    
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .dispatcher-header,
    .kanban-header,
    .planner-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Quick Add Button */
.quick-add-btn {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: var(--accent-blue) !important;
    color: var(--bg-primary) !important;
    border: none !important;
    font-size: 24px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px var(--shadow) !important;
    transition: all 0.3s;
    z-index: 9999 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.quick-add-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow);
}

/* Grid View */
.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.grid-header h2 {
    margin: 0;
}

.grid-sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.grid-sort-controls label {
    font-size: 14px;
    color: var(--text-secondary);
}

.grid-sort-controls select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.grid-sort-controls select:hover {
    border-color: var(--accent-blue);
}

.grid-container {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px;
    overflow-x: auto;
}

.grid-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    color: #333;
    font-size: 13px;
}

.grid-table thead {
    background: #f5f5f5;
    position: sticky;
    top: 0;
    z-index: 10;
}

.grid-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
    border-right: 1px solid #ddd;
    white-space: nowrap;
    background: #f5f5f5;
}

.grid-table th:last-child {
    border-right: none;
}

.grid-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    white-space: nowrap;
}

.grid-table td:last-child {
    border-right: none;
}

.grid-table tbody tr {
    transition: background-color 0.2s;
}

.grid-table tbody tr:hover {
    background-color: #f9f9f9;
}

.grid-table tbody tr .task-name-cell.priority-1 {
    background-color: #ffe6e6;
}

.grid-table tbody tr:hover .task-name-cell.priority-1 {
    background-color: #ffd6d6;
}

.grid-table tbody tr .task-name-cell.priority-2 {
    background-color: #fff4e6;
}

.grid-table tbody tr:hover .task-name-cell.priority-2 {
    background-color: #ffead6;
}

.grid-table tbody tr .task-name-cell.priority-3 {
    background-color: #e6ffe6;
}

.grid-table tbody tr:hover .task-name-cell.priority-3 {
    background-color: #d6ffd6;
}

.grid-table tbody tr td a {
    color: #0066cc;
    text-decoration: none;
}

.grid-table tbody tr td a:hover {
    text-decoration: underline;
}
