:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --success-bg: #d1fae5;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --warning: #f59e0b;
    --info: #06b6d4;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(37, 99, 235, 0.12);
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Login View */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: var(--card);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-card p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

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

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* Dashboard */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.navbar {
    background: var(--card);
    padding: 1rem 2rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.navbar h1 {
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge {
    background: #eff6ff;
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Cards */
.card {
    background: var(--card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-lg);
    overflow: visible;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Section Personnel Card - border'ların kesilmemesi için */
.section-personnel.card {
    padding-bottom: 2rem !important;
    overflow: visible !important;
    border-radius: 0 !important; /* Border-radius border'ları kesiyor, kaldırıyoruz */
}

/* Card'ın border-radius'u border'ları kesmesin diye */
.section-personnel .attendance-item {
    margin-left: -1px;
    margin-right: -1px;
}

/* Section Personnel - border'ların kesilmemesi için */
.section-personnel {
    overflow: visible !important;
    padding-bottom: 1.5rem !important;
}

.section-personnel .attendance-checklist {
    margin-bottom: 0;
    padding-bottom: 0;
    overflow: visible;
    position: relative;
}

.section-personnel .attendance-item {
    position: relative;
    z-index: 1;
    margin-left: -1px;
    margin-right: -1px;
    width: calc(100% + 2px);
}

.section-personnel .attendance-item:last-child {
    margin-bottom: 0;
}

.card h2 {
    margin-bottom: 1rem;
    color: var(--text);
}

.card h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

/* Checklist */
.checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checklist li {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.checklist li:last-child {
    border-bottom: none;
}

/* Attendance checklist - border'ları düzelt */
.attendance-checklist {
    padding: 0;
    margin: 0;
    overflow: visible;
}

.attendance-checklist li {
    border-bottom: none;
    padding: 0;
    margin-bottom: 0.75rem;
}

.attendance-checklist li:last-child {
    margin-bottom: 0;
}

/* Attendance Item - Profesyonel Tasarım */
.attendance-item {
    padding: 1rem 1.25rem !important;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    background: var(--card);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    display: block;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    overflow: visible;
}

.attendance-item:hover {
    /* border-color: var(--primary); - Geçici olarak kaldırıldı */
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.attendance-item.checked {
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.attendance-item.checked:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.attendance-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 1rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.attendance-label {
    flex: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.attendance-name {
    transition: all 0.3s ease;
}

/* Layout'a göre isim gösterimi */
.personnel-grid.layout-compact .attendance-name {
    display: none;
}

.personnel-grid.layout-normal .attendance-name {
    display: block;
}

.attendance-item.checked .attendance-name {
    font-weight: 600;
}

.checklist input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    margin-right: 0.75rem;
}

.checklist label {
    flex: 1;
    cursor: pointer;
}

.checklist input:checked + label {
    color: var(--text-muted);
}

/* Attendance Checklist - Üstü çizilmesin */
.attendance-checklist input:checked + label {
    text-decoration: none;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.staff-card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.staff-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Textarea */
textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Notion-style Block Editor */
.notes-editor {
    min-height: 300px;
    padding: 0.5rem;
}

.note-block {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.25rem 0;
    position: relative;
    transition: background 0.2s;
}

.note-block:hover {
    background: rgba(0, 0, 0, 0.02);
}

.note-block:hover .block-actions {
    opacity: 1;
}

.block-actions {
    position: absolute;
    left: -2rem;
    top: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    gap: 0.25rem;
}

.block-actions button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Grid Layout for Notes */
.notes-editor-container.layout-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.25rem;
}

.grid-card {
    aspect-ratio: 1 / 1;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.grid-card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    background: #fdfdfd;
}

.grid-card .block-actions {
    position: absolute;
    right: 4px;
    top: 4px;
    left: auto;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.grid-card:hover .block-actions {
    opacity: 1;
}

.grid-card .block-content-wrapper {
    width: 100%;
    height: 100%;
}

.grid-card .block-content {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: var(--text) !important;
    resize: none !important;
    box-shadow: none !important;
    line-height: 1.2 !important;
}

.grid-card .block-content::placeholder {
    color: #cbd5e1;
}

/* Bullet List Layout for Notes */
.notes-editor-container.layout-bullet-list .note-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
}

.notes-editor-container.layout-bullet-list .note-block::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
    padding-left: 0.5rem;
}

.notes-editor-container.layout-bullet-list .block-actions {
    left: -2.5rem;
}

.notes-editor-container.layout-bullet-list .block-content {
    border: none !important;
    background: transparent !important;
    padding: 0.2rem 0.5rem !important;
    font-size: 0.95rem !important;
}

@media (max-width: 480px) {
    .notes-editor-container.layout-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.block-actions button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

.block-content input[type="text"],
.block-content textarea {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.25rem 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    min-height: 1.5rem;
    line-height: 1.5;
}

.block-content input[type="text"]:focus,
.block-content textarea:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
}

.block-content textarea {
    min-height: 3rem;
    overflow: hidden;
}

/* Block Types */
.block-heading1 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.block-heading2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.block-heading3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

.block-paragraph {
    font-size: 0.95rem;
    line-height: 1.6;
}

.block-bullet,
.block-numbered {
    font-size: 0.95rem;
    line-height: 1.6;
    padding-left: 0.5rem;
}

.block-todo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.block-todo input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.block-todo input[type="text"] {
    flex: 1;
}

.block-todo.completed input[type="text"] {
    text-decoration: line-through;
    color: var(--text-muted);
}

.add-block-btn {
    margin-top: 0.5rem;
    padding: 0.5rem;
    width: 100%;
    border: 1px dashed var(--border);
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.add-block-btn:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

.block-menu {
    position: absolute;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    z-index: 100;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.block-menu-item {
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s;
}

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

.block-menu-item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.block-menu-item-text {
    flex: 1;
}

.block-menu-item-text strong {
    display: block;
    font-size: 0.9rem;
}

.block-menu-item-text small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Inline Form */
.inline-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.inline-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.inline-form button {
    padding: 0.5rem 1rem;
    background: var(--text);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

/* Progress */
.progress-bar {
    width: 100px;
    height: 6px;
    background: #eee;
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s;
}

/* Activity Ring */
.activity-ring-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
}
.activity-ring-container:hover { transform: scale(1.05); }
.activity-ring-container:active { transform: scale(0.95); }
.activity-ring-svg { transform: rotate(-90deg); }
.activity-ring-bg { fill: none; stroke: var(--border); stroke-width: 5; }
.activity-ring-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
}
.activity-count-wrapper {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.activity-count { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.activity-target { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

/* Mobile Dashboard Layout */
.mobile-dashboard {
    background: #f1f5f9;
    min-height: 100vh;
    padding-bottom: 80px; /* Space for bottom nav */
}
.mockup-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.25rem;
    background: white;
}
.mockup-mobile-header h1 { font-size: 1.25rem; font-weight: 800; color: #1e293b; }
.mockup-mobile-avatar img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--primary-light); }
.mockup-card { background: white; margin: 0.75rem; border-radius: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); overflow: hidden; }
.mockup-card-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid #f1f5f9; }
.mockup-card-title { font-size: 0.75rem; font-weight: 700; color: #64748b; letter-spacing: 0.05em; }
.mockup-ring-card { display: flex; align-items: center; padding: 1.25rem; gap: 1rem; }
.mockup-week-info { flex: 1; font-weight: 600; color: #334155; }
.mockup-progress-container { width: 60px; height: 6px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.mockup-progress-fill { height: 100%; background: var(--success); border-radius: 99px; transition: width 0.5s ease; }

/* Attendance Chips (Mobile) */
.attendance-chips-container {
    display: flex;
    overflow-x: auto;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.attendance-chips-container::-webkit-scrollbar { display: none; } /* Hide scrollbar Chrome/Safari */
.attendance-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem 0.5rem 0.5rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 99px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.attendance-chip.active { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2); }
.chip-circle { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.75rem; transition: all 0.2s; }
.chip-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }

/* Mobile Checklist */
.mockup-checklist { list-style: none; padding: 0.5rem 0; }
.mockup-checklist li { display: flex; align-items: center; padding: 0.875rem 1.25rem; border-bottom: 1px solid #f8fafc; gap: 0.875rem; }
.mockup-checklist li:last-child { border-bottom: none; }
.mockup-checkbox { width: 22px; height: 22px; border: 2px solid #cbd5e1; border-radius: 6px; transition: all 0.2s; flex-shrink: 0; position: relative; }
.mockup-checkbox.checked { background: var(--primary); border-color: var(--primary); }
.mockup-checkbox.checked::after { content: '✓'; position: absolute; color: white; font-size: 14px; font-weight: 800; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.mockup-task-text { font-size: 0.9rem; color: #334155; font-weight: 500; transition: all 0.2s; }
.mockup-task-text.checked { color: #94a3b8; text-decoration: line-through; }

/* Bottom Nav */
.mockup-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.03);
    z-index: 100;
}
.mockup-nav-item { color: #94a3b8; padding: 0.5rem; transition: all 0.2s; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mockup-nav-item svg { width: 24px; height: 24px; }
.mockup-nav-item.active { color: var(--primary); }

/* Pending Delete State */
.task-pending-delete {
    background-color: var(--danger) !important;
    transition: background-color 0.3s ease;
}

.task-pending-delete label,
.task-pending-delete .mockup-task-text {
    color: white !important;
}

.task-pending-delete .btn-danger,
.task-pending-delete .mobile-task-delete {
    background: white !important;
    color: var(--danger) !important;
    border: 1px solid white !important;
    font-weight: 700;
}

/* Empty State */
.empty-state {
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem 0;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Three Column Layout */
.three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Personnel Grid - Dinamik Layout */
.personnel-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1.5rem;
    transition: grid-template-columns 0.3s ease;
}

.section-header {
    transition: all 0.2s;
    padding: 0.5rem;
    margin: -0.5rem -0.5rem 1rem -0.5rem;
    border-radius: var(--radius);
}

.section-header:hover {
    background: var(--bg);
}

@media (max-width: 1024px) {
    .three-col,
    .personnel-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal {
    background: var(--card);
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.modal-close:hover {
    background: var(--bg);
}

/* Toast/Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--card);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .dashboard {
        padding: 1rem;
    }
    
    .navbar {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .navbar-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* Custom Dropdown */
.custom-select-wrapper {
    position: relative;
    display: inline-block;
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
}

.custom-select:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.custom-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.custom-select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.custom-select-wrapper:hover::after {
    color: var(--primary);
}

.custom-select:focus ~ .custom-select-wrapper::after,
.custom-select-wrapper:has(.custom-select:focus)::after {
    transform: translateY(-50%) rotate(180deg);
    color: var(--primary);
}

/* Week Cards - Modern Design (Gradient Style) */
.week-card-modern {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.week-card-modern:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.week-card-modern.selected {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2), var(--shadow-lg);
    animation: pulse-border 8s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2), var(--shadow-lg);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.15), var(--shadow-lg);
    }
}

.week-card-gradient {
    position: relative;
}

.week-card-gradient::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.05) 100%);
    pointer-events: none;
}

.week-card-content {
    border-top: 1px solid var(--border);
}

.week-card-modern:hover .week-card-gradient {
    transform: scale(1.05);
    transition: transform 1s ease;
}

.week-card-modern.selected .week-card-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    animation: shimmer 6s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Typography Improvements */
h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

/* Icon Styles */
.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

/* --- Personnel Tasks & Two-step Deletion --- */
.task-personnel,
.task-personnel-text,
.mockup-task-text.task-personnel-text {
    color: #8b5cf6 !important;
    font-weight: 600;
}

.checklist li.confirm-delete,
.mockup-checklist li.confirm-delete {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    transition: all 0.2s ease;
}

.checklist li.confirm-delete label,
.checklist li.confirm-delete .attendance-name,
.mockup-checklist li.confirm-delete .mockup-task-text {
    color: white !important;
}

.checklist li.confirm-delete .task-delete-trigger,
.mockup-checklist li.confirm-delete .mobile-task-delete-trigger {
    background: white !important;
    color: var(--danger) !important;
    border: none !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.checklist li.confirm-delete input[type="checkbox"],
.mockup-checklist li.confirm-delete .mockup-checkbox {
    border-color: rgba(255,255,255,0.5) !important;
}

/* Mobile Task Enhancements */
.mockup-card .inline-form {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.75rem !important;
    margin: 0.5rem 1rem 1rem 1rem !important;
    border: 1px solid var(--border);
}

/* --- CALENDAR VIEW (Modern Inspiration) --- */
.calendar-view {
    padding-bottom: 24px; /* Reduced from 90px to prevent huge gap when no nav */
    background: #f5f5f7; /* Apple light gray */
    min-height: 100%; /* Better than 100vh which can force scrolling */
    display: flex;
    flex-direction: column;
}

/* Ensure bottom padding only applies when nav is actually present */
.calendar-view:has(.mockup-bottom-nav) {
    padding-bottom: 85px;
}

.calendar-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.calendar-main-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #4b5563; /* slate-600 */
    margin: 0;
}

.calendar-semester-switcher {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: transparent;
}

.semester-nav-btn {
    background: white;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s;
}

.semester-nav-btn:active {
    transform: scale(0.95);
    background: #f9fafb;
}

.semester-label {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.semester-name {
    font-weight: 800;
    color: #374151; /* slate-700 */
    font-size: 1.1rem;
}

.semester-year {
    font-size: 0.75rem;
    color: #9ca3af; /* gray-400 */
    font-weight: 600;
}

/* Month Grid - Optimized Flex Layout for Perfect Squares */
.calendar-month-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem 3rem 2rem;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: wrap; /* Wraps gracefully if screen gets narrow */
}

.month-block {
    width: 110px;
    height: 110px;
    background: #ffffff;
    border-radius: 22px; /* Apple-like squircle */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05); /* Premium soft drop shadow */
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.2s ease;
    border: 1px solid rgba(0,0,0,0.02);
}

.month-block:hover {
    transform: scale(1.03); /* Simple float */
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* Minimalist Apple-like typography for the month name */
.month-name {
    color: #1d1d1f; /* Standard dark text */
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
}

/* Current month indicator */
.month-current-dot {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #007aff; /* Apple blue */
    border-radius: 50%;
}

/* Mobile specific layout for Month Grid */
@media (max-width: 768px) {
    .calendar-month-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 3 columns, naturally 2 rows */
        gap: 0.75rem; /* Compact gap */
        padding: 1rem 1.25rem 2rem 1.25rem; /* Responsive padding */
        width: 100%;
    }
    .month-block {
        width: 100%; /* Fill the grid column */
        height: auto;
        aspect-ratio: 1/1; /* Keep it perfectly square based on responsive width */
        border-radius: 14px; /* Softer radius for smaller mobile squares */
        padding: 5%; /* Minimal padding so text fits */
    }
    .month-name {
        font-size: 0.9rem; /* Responsive text size for 3-column mobile */
    }
    .month-current-dot {
        bottom: 8px; /* Tighter dot position */
        width: 5px;
        height: 5px;
    }
}

/* Interactions */
.month-block:active {
    transform: scale(0.95);
}

.month-block.expanded {
    box-shadow: 0 0 0 2px var(--primary-light), 0 8px 20px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

/* Weeks Panel */
.calendar-weeks-panel {
    margin: 0 1.25rem 1rem 1.25rem; /* Reduced bottom margin */
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-grow: 1; /* Allow it to naturally fill remaining space if needed */
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.weeks-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.weeks-panel-title {
    font-weight: 800;
    color: #475569;
}

.weeks-panel-close {
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: background 0.2s;
}

.weeks-panel-close:active {
    transform: scale(0.9);
}

.weeks-list {
    padding: 0.5rem;
}

.calendar-week-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-week-card:hover {
    background: white;
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transform: translateY(-1px);
}

.calendar-week-card:active {
    transform: scale(0.98);
}

.calendar-week-card.current-week {
    background: var(--primary-light);
    border-color: #bfdbfe;
}

.week-card-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.week-card-number {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.calendar-week-card.current-week .week-card-number {
    background: var(--primary);
    color: white;
}

.week-card-info {
    display: flex;
    flex-direction: column;
}

.week-card-label {
    font-weight: 700;
    color: #334155;
    font-size: 0.95rem;
}

.week-card-dates {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.week-card-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.current-week-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    font-weight: 700;
}

.week-card-rt {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 700;
}

.week-card-arrow {
    color: #cbd5e1;
}

.weeks-empty {
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
    font-weight: 600;
}
