/* ==========================================================================
   CSS Stylesheet for Chum Saeng Songkhram School To-Do List Management System
   ========================================================================== */

/* CSS Variables for Themes */
:root {
    /* Color Palette - Light Mode */
    --primary: #1e40af;       /* Deep Royal Blue */
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --accent: #d97706;        /* Warm Gold/Amber */
    --accent-light: #fef9c3;
    --bg-app: #f1f5f9;        /* Slate 100 */
    --bg-sidebar: #0f172a;    /* Slate 900 */
    --bg-card: #ffffff;
    --text-main: #1e293b;     /* Slate 800 */
    --text-light: #ffffff;
    --text-muted: #64748b;    /* Slate 500 */
    --border-color: #cbd5e1;  /* Slate 300 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Status Colors */
    --color-todo: #f59e0b;     /* Amber */
    --color-todo-bg: #fef3c7;
    --color-doing: #2563eb;    /* Blue */
    --color-doing-bg: #dbeafe;
    --color-done: #10b981;     /* Emerald */
    --color-done-bg: #d1fae5;
    
    /* Priority Colors */
    --priority-low: #64748b;
    --priority-low-bg: #f1f5f9;
    --priority-medium: #d97706;
    --priority-medium-bg: #fef3c7;
    --priority-high: #dc2626;  /* Red */
    --priority-high-bg: #fee2e2;

    /* Interface Variables */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    --sidebar-width: 280px;
    --simulator-height: 54px;
}

/* Dark Mode Overrides */
body.dark-theme {
    --bg-app: #090d16;
    --bg-card: #151f32;
    --text-main: #f1f5f9;     /* Slate 100 */
    --text-muted: #94a3b8;    /* Slate 400 */
    --border-color: #1e293b;  /* Slate 800 */
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.15);
    --accent: #f59e0b;
    --accent-light: rgba(245, 158, 11, 0.15);

    --color-todo-bg: rgba(245, 158, 11, 0.15);
    --color-doing-bg: rgba(37, 99, 235, 0.15);
    --color-done-bg: rgba(16, 185, 129, 0.15);

    --priority-low-bg: rgba(100, 116, 139, 0.15);
    --priority-medium-bg: rgba(217, 119, 6, 0.15);
    --priority-high-bg: rgba(220, 38, 38, 0.15);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
    height: 100vh;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* UTILITY BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-light);
    box-shadow: 0 4px 10px rgba(30, 64, 175, 0.2);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-main);
}
.btn-secondary:hover {
    background-color: var(--text-muted);
    color: #fff;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover {
    background-color: var(--primary);
    color: var(--text-light);
}

.btn-xs {
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-danger {
    background-color: var(--priority-high);
    color: var(--text-light);
}
.btn-danger:hover {
    background-color: #b91c1c;
}

/* ROLE SIMULATOR BAR */
.simulator-bar {
    height: var(--simulator-height);
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #eab308; /* Yellow/Gold Accent Line */
    box-shadow: var(--shadow-md);
}

.simulator-content {
    display: flex;
    align-items: center;
    padding: 0 20px;
    width: 100%;
    gap: 15px;
}

.simulator-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.simulator-select-wrapper select {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 6px 30px 6px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
    min-width: 250px;
    transition: all var(--transition-fast);
}

.simulator-select-wrapper select:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #eab308;
}

.active-user-badge {
    margin-left: auto;
    font-size: 0.85rem;
    background: rgba(234, 179, 8, 0.15);
    color: #fcd34d;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(234, 179, 8, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* APP CONTAINER */
.app-container {
    display: flex;
    height: calc(100vh - var(--simulator-height));
    margin-top: var(--simulator-height);
}

/* SIDEBAR STYLES */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
    z-index: 10;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background-color: #ffffff;
    padding: 3px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.school-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.school-info {
    display: flex;
    flex-direction: column;
}

.school-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
    line-height: 1.2;
}

.school-subname {
    font-size: 0.72rem;
    color: #cbd5e1;
    font-weight: 400;
}

.sidebar-menu {
    flex-grow: 1;
    padding: 20px 10px;
}

.sidebar-menu ul {
    list-style: none;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    color: #94a3b8;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 6px;
    transition: all var(--transition-fast);
}

.menu-item:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
    color: #ffffff;
    background-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.theme-icon-light {
    display: none;
}

body.dark-theme .theme-icon-dark {
    display: none;
}

body.dark-theme .theme-icon-light {
    display: inline-block;
    color: #f59e0b;
}

.version-tag {
    font-size: 0.7rem;
    color: #475569;
    text-align: center;
}

/* MAIN CONTENT AREA */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 15px;
}

.content-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
}

.content-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.date-display {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

/* SECTIONS STRUCTURE */
.content-section {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    flex-grow: 1;
}

.content-section.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
}

/* SECTION 1: DASHBOARD */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
}

.icon-all { background: linear-gradient(135deg, #4f46e5, #6366f1); }
.icon-todo { background: linear-gradient(135deg, #d97706, #f59e0b); }
.icon-doing { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.icon-done { background: linear-gradient(135deg, #059669, #10b981); }

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-card .card-header {
    padding: 16px 20px;
    border-bottom: 1.5px solid var(--border-color);
    background-color: rgba(0,0,0,0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-card .card-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-card .card-body {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

/* Department progress items */
.dept-progress-item {
    margin-bottom: 20px;
}

.dept-progress-item:last-child {
    margin-bottom: 0;
}

.dept-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.dept-progress-bar-bg {
    height: 12px;
    background-color: var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.dept-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #3b82f6);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
    width: 0%;
}

.dept-progress-stats {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Dashboard Urgent Tasks Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.dashboard-table th {
    padding: 10px 12px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
}

.dashboard-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.dashboard-table tbody tr:last-child td {
    border-bottom: none;
}

/* SECTION 2: KANBAN BOARD */
.kanban-filter-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

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

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.filter-group select {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
}

.kanban-filter-bar button {
    margin-left: auto;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    flex-grow: 1;
    min-height: 500px;
}

@media (max-width: 768px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
}

.kanban-column {
    background-color: rgba(0, 0, 0, 0.02);
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    padding: 16px;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

body.dark-theme .kanban-column {
    background-color: rgba(255, 255, 255, 0.02);
}

.kanban-column.dragover {
    background-color: var(--primary-light);
    border-color: var(--primary);
}

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

.column-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.column-count {
    background-color: var(--border-color);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.header-todo { border-bottom-color: var(--color-todo); color: var(--color-todo); }
.header-doing { border-bottom-color: var(--color-doing); color: var(--color-doing); }
.header-done { border-bottom-color: var(--color-done); color: var(--color-done); }

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
    overflow-y: auto;
    max-height: calc(100vh - 290px);
}

/* Task Card Style */
.task-card {
    background-color: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    position: relative;
    user-select: none;
}

.task-card:active {
    cursor: grabbing;
}

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

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

.task-priority-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.task-priority-badge.priority-high {
    background-color: var(--priority-high-bg);
    color: var(--priority-high);
}
.task-priority-badge.priority-medium {
    background-color: var(--priority-medium-bg);
    color: var(--priority-medium);
}
.task-priority-badge.priority-normal {
    background-color: var(--priority-low-bg);
    color: var(--priority-low);
}

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

.card-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px 4px;
    font-size: 0.8rem;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.card-action-btn:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}

.task-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 8px;
}

.task-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    font-size: 0.76rem;
}

.task-assignee-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    font-weight: 500;
}

.task-assignee-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #fff;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.task-deadline-info {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-deadline-info.overdue {
    color: var(--priority-high);
    font-weight: 600;
}

/* SECTION 3: TASK MANAGEMENT */
.management-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

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

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--primary);
}

.filter-controls {
    display: flex;
    gap: 12px;
}

.filter-controls select {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}

.management-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.management-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.management-table th {
    padding: 14px 18px;
    background-color: rgba(0,0,0,0.01);
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
}

body.dark-theme .management-table th {
    background-color: rgba(255,255,255,0.01);
}

.management-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.management-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

body.dark-theme .management-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

.status-badge {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge.status-todo {
    background-color: var(--color-todo-bg);
    color: var(--color-todo);
}

.status-badge.status-doing {
    background-color: var(--color-doing-bg);
    color: var(--color-doing);
}

.status-badge.status-done {
    background-color: var(--color-done-bg);
    color: var(--color-done);
}

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

/* SECTION 4: SETTINGS */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.settings-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

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

.settings-card .card-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-card .card-body {
    padding: 15px;
    max-height: 480px;
    overflow-y: auto;
}

.settings-list {
    list-style: none;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    background-color: rgba(0, 0, 0, 0.005);
    transition: all var(--transition-fast);
}

.settings-item:hover {
    border-color: var(--text-muted);
}

.settings-item-info {
    display: flex;
    flex-direction: column;
}

.settings-item-title {
    font-weight: 600;
    font-size: 0.92rem;
}

.settings-item-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

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

/* MODALS STYLES */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn var(--transition-fast);
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp var(--transition-fast);
}

.modal-content.modal-sm {
    max-width: 400px;
}

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

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.close {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition-fast);
}

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

.modal-content form {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

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

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-group label.required::after {
    content: " *";
    color: var(--priority-high);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1.5px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Task Details View Mode */
.task-details-view {
    padding: 24px 20px;
}

.details-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary);
    line-height: 1.3;
}

.details-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.meta-val {
    font-size: 0.92rem;
    font-weight: 500;
    margin-top: 2px;
}

.details-desc-box {
    background-color: rgba(0, 0, 0, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 15px;
}

body.dark-theme .details-desc-box {
    background-color: rgba(255, 255, 255, 0.015);
}

.details-desc-box h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.details-desc-box p {
    font-size: 0.9rem;
    white-space: pre-wrap;
    line-height: 1.6;
}

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

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

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

.empty-state i {
    font-size: 2.5rem;
    color: var(--border-color);
}

.empty-state p {
    font-size: 0.9rem;
}
