/* DESIGN SYSTEM & GLOBAL CONFIGURATION */
:root {
    --font-primary: 'Inter', 'Prompt', sans-serif;
    
    /* Dark Theme Colors */
    --bg-app: radial-gradient(circle at 10% 20%, #0d1321 0%, #080b11 90%);
    --bg-sidebar: rgba(10, 15, 26, 0.75);
    --bg-card: rgba(20, 30, 48, 0.45);
    --bg-card-hover: rgba(30, 45, 75, 0.6);
    --bg-input: rgba(15, 23, 38, 0.8);
    
    /* Borders & Outlines */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.18);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glow-shadow: 0 0 15px rgba(0, 229, 255, 0.25);
    
    /* Text Colors */
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #111827;
    
    /* Accent Colors */
    --primary: #3b82f6; /* Blue */
    --primary-glow: rgba(59, 130, 246, 0.35);
    --secondary: #00e5ff; /* Cyan */
    
    /* Status Colors */
    --color-todo: #94a3b8;
    --color-progress: #eab308;
    --color-review: #a855f7;
    --color-done: #10b981;
    --color-overdue: #f43f5e;
    
    /* Urgency Colors (ระดับความเร่งด่วน) */
    --urgency-urgent: #f59e0b; /* ด่วน */
    --urgency-v-urgent: #f97316; /* ด่วนมาก */
    --urgency-most-urgent: #ef4444; /* ด่วนที่สุด */
    
    /* Secrecy Colors (ชั้นความลับ) */
    --secrecy-normal: #10b981; /* ปกติ */
    --secrecy-confidential: #8b5cf6; /* ลับ */
    --secrecy-secret: #d946ef; /* ลับมาก */
    --secrecy-top-secret: #f43f5e; /* ลับที่สุด */
    
    /* Transition Speed */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Light Theme overrides (Optional / Standard Toggle) */
.light-theme {
    --bg-app: radial-gradient(circle at 10% 20%, #f3f4f6 0%, #e5e7eb 90%);
    --bg-sidebar: rgba(255, 255, 255, 0.85);
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.9);
    --bg-input: rgba(243, 244, 246, 0.9);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-hover: rgba(0, 0, 0, 0.15);
    --text-primary: #111827;
    --text-muted: #4b5563;
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --primary: #1d4ed8;
}

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

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

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Utility Classes */
.d-none { display: none !important; }
.text-danger { color: var(--color-overdue) !important; }
.text-warning { color: var(--color-progress) !important; }
.text-success { color: var(--color-done) !important; }
.text-info { color: var(--primary) !important; }

/* LAYOUT CONTAINER */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    position: relative;
}

/* SIDEBAR STYLING */
.sidebar {
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-normal);
}

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

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

.logo-icon {
    font-size: 28px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(0, 229, 255, 0.4));
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.close-sidebar-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: none;
}

/* USER PROFILE SELECTOR / SWITCHER */
.user-profile-selector {
    margin-bottom: 25px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.selector-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.custom-select-wrapper select {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: border-color var(--transition-fast);
}

.custom-select-wrapper select:focus {
    border-color: var(--primary);
}

/* SIDEBAR NAV LINKS */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-group-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 6px;
    padding-left: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-link:hover, .nav-link.active {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-left: 3px solid var(--primary);
    padding-left: 13px;
    box-shadow: var(--glow-shadow);
}

.sidebar-footer {
    padding-top: 15px;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}

.current-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-sm {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.avatar-xs {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--secondary);
    background: rgba(255, 255, 255, 0.1);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role-badge {
    font-size: 10px;
    color: var(--secondary);
    font-weight: 500;
}

/* MAIN CONTENT AREA STYLING */
.main-content {
    padding: 30px;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* TOP HEADER */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

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

.toggle-sidebar-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    display: none;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

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

.current-time-widget {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.theme-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--glass-border-hover);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    font-family: var(--font-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
    background: var(--bg-card);
    border-color: var(--glass-border);
    color: var(--text-primary);
}

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

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #047857);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* GLASS CARD STYLING */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-card:hover {
    border-color: var(--glass-border-hover);
}

/* METRICS GRID */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.metric-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.metric-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
}

.metric-icon {
    font-size: 36px;
    opacity: 0.25;
}

.border-left-info { border-left: 4px solid var(--primary); }
.border-left-warning { border-left: 4px solid var(--color-progress); }
.border-left-review { border-left: 4px solid var(--color-review); }
.border-left-success { border-left: 4px solid var(--color-done); }
.border-left-danger { border-left: 4px solid var(--color-overdue); }

/* CHARTS SECTION */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 25px;
}

.chart-container {
    padding: 24px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-wrapper {
    position: relative;
    height: 280px;
    width: 100%;
}

/* TABLES & LIST CONTAINER */
.table-container {
    padding: 24px;
}

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

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--glass-border);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* User column in tables */
.table-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

/* PROGRESS BAR */
.progress-bar-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.5s ease-in-out;
}

/* FILTER BAR */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 18px 24px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
    flex: 1;
}

.filter-group-search {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 250px;
    flex: 2;
}

.filter-bar label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.form-control {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    width: 100%;
    font-family: var(--font-primary);
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.text-area {
    resize: none;
}

/* BADGES (STATUS, URGENCY, SECRECY) */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-todo { background: rgba(148, 163, 184, 0.15); color: var(--color-todo); }
.badge-todo::before { background: var(--color-todo); }

.badge-progress { background: rgba(234, 179, 8, 0.15); color: var(--color-progress); }
.badge-progress::before { background: var(--color-progress); }

.badge-review { background: rgba(168, 85, 247, 0.15); color: var(--color-review); }
.badge-review::before { background: var(--color-review); }

.badge-done { background: rgba(16, 185, 129, 0.15); color: var(--color-done); }
.badge-done::before { background: var(--color-done); }

.badge-overdue { background: rgba(244, 63, 94, 0.15); color: var(--color-overdue); }
.badge-overdue::before { background: var(--color-overdue); }

/* Urgency badges */
.urgency-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.urgency-urgent { background: rgba(245, 158, 11, 0.2); color: var(--urgency-urgent); border: 1px solid rgba(245, 158, 11, 0.3); }
.urgency-v-urgent { background: rgba(249, 115, 22, 0.2); color: var(--urgency-v-urgent); border: 1px solid rgba(249, 115, 22, 0.3); }
.urgency-most-urgent { 
    background: rgba(239, 68, 68, 0.25); 
    color: var(--urgency-most-urgent); 
    border: 1px solid rgba(239, 68, 68, 0.4);
    animation: urgent-pulse 1.5s infinite;
}

@keyframes urgent-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Secrecy / Classification badges */
.secrecy-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.secrecy-normal { background: rgba(16, 185, 129, 0.15); color: var(--secrecy-normal); border: 1px solid rgba(16, 185, 129, 0.25); }
.secrecy-confidential { background: rgba(139, 92, 246, 0.15); color: var(--secrecy-confidential); border: 1px solid rgba(139, 92, 246, 0.25); }
.secrecy-secret { background: rgba(217, 70, 239, 0.15); color: var(--secrecy-secret); border: 1px solid rgba(217, 70, 239, 0.25); }
.secrecy-top-secret { 
    background: rgba(244, 63, 94, 0.2); 
    color: var(--secrecy-top-secret); 
    border: 1px solid rgba(244, 63, 94, 0.4);
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.2);
}

/* TEAM MANAGEMENT VIEW */
.team-management-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 25px;
    align-items: start;
}

.avatar-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.avatar-opt {
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    padding: 3px;
    transition: all var(--transition-fast);
    background: rgba(255, 255, 255, 0.05);
}

.avatar-opt:hover {
    background: rgba(255, 255, 255, 0.1);
}

.avatar-opt.selected {
    border-color: var(--secondary);
    background: rgba(0, 229, 255, 0.15);
    box-shadow: var(--glow-shadow);
}

.team-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.team-member-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    border: 1px solid var(--glass-border);
}

.btn-remove-member {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: color var(--transition-fast);
}

.btn-remove-member:hover {
    color: var(--color-overdue);
}

.member-avatar-box {
    margin-bottom: 12px;
    position: relative;
}

.member-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.member-role {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.member-task-stats {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 12px;
}

.member-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.member-stat-num {
    font-weight: 700;
    font-size: 14px;
}

.member-stat-lbl {
    font-size: 10px;
    color: var(--text-muted);
}

/* STAFF PROFILE HEADER (KANBAN VIEW) */
.staff-header-profile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
}

.staff-profile-main {
    display: flex;
    align-items: center;
    gap: 20px;
}

.staff-profile-details h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.staff-profile-details p {
    font-size: 13px;
    color: var(--text-muted);
}

.staff-profile-stats {
    display: flex;
    gap: 20px;
}

.profile-stat-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 10px 18px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
}

.stat-num {
    font-size: 20px;
    font-weight: 700;
}

.stat-lbl {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* KANBAN BOARD */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: start;
    min-height: 550px;
}

.kanban-column {
    background: rgba(10, 15, 26, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: calc(100vh - 280px);
}

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

.column-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.bg-todo { background-color: var(--color-todo); }
.bg-progress { background-color: var(--color-progress); }
.bg-review { background-color: var(--color-review); }
.bg-done { background-color: var(--color-done); }

.column-count {
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
}

.kanban-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 400px;
    overflow-y: auto;
    padding: 2px;
}

/* KANBAN CARD STYLING */
.kanban-card {
    padding: 16px;
    cursor: grab;
    user-select: none;
    border: 1px solid var(--glass-border);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

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

.kanban-card.dragging {
    opacity: 0.5;
    border: 2px dashed var(--primary) !important;
}

/* Glow border for highly secret tasks */
.kanban-card-top-secret {
    border-left: 4px solid var(--secrecy-top-secret);
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.15);
}
.kanban-card-top-secret:hover {
    box-shadow: 0 8px 25px rgba(244, 63, 94, 0.25);
    border-color: rgba(244, 63, 94, 0.5);
}

.kanban-card-secret {
    border-left: 4px solid var(--secrecy-secret);
}

.kanban-card-confidential {
    border-left: 4px solid var(--secrecy-confidential);
}

.kanban-card-normal {
    border-left: 4px solid var(--secrecy-normal);
}

.card-header-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-task-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-primary);
}

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

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
    margin-top: 10px;
}

.card-dates {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.deadline-danger {
    color: var(--color-overdue) !important;
    font-weight: 600;
}

.deadline-warning {
    color: var(--color-progress) !important;
    font-weight: 600;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-btn-edit {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: color var(--transition-fast);
}

.card-btn-edit:hover {
    color: var(--primary);
}

/* MODALS LAYOUT */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 200;
    transition: opacity var(--transition-normal);
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-backdrop.show .modal {
    transform: scale(1);
}

.modal-lg {
    max-width: 800px;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-with-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-secrecy-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    background: var(--secrecy-top-secret);
    color: white;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

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

/* Form Row Grid inside Modals */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.required {
    color: var(--color-overdue);
    margin-right: 2px;
}

/* DETAIL MODAL CUSTOM STYLES */
.detail-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 24px;
}

.detail-main-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-sec-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-left: 3px solid var(--secondary);
    padding-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-desc {
    font-size: 14px;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 8px;
    white-space: pre-line;
}

/* Activity log list */
.activity-log {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 8px;
}

.activity-item {
    font-size: 12px;
    border-left: 2px solid var(--glass-border);
    padding-left: 12px;
    position: relative;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--glass-border);
}

.activity-item.active-step::before {
    background: var(--secondary);
}

.activity-time {
    color: var(--text-muted);
    font-size: 10px;
    display: block;
    margin-top: 2px;
}

.detail-meta-info {
    padding: 20px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: fit-content;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.meta-label {
    color: var(--text-muted);
}

.meta-value {
    font-weight: 600;
}

.meta-value-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

/* TOAST NOTIFICATION SYSTEM */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 300;
}

.toast {
    background: rgba(10, 15, 26, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    transform: translateY(30px);
    opacity: 0;
    animation: toast-in 0.3s forwards;
}

@keyframes toast-in {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast.toast-success { border-left: 4px solid var(--color-done); }
.toast.toast-warning { border-left: 4px solid var(--color-progress); }
.toast.toast-danger { border-left: 4px solid var(--color-overdue); }
.toast.toast-info { border-left: 4px solid var(--primary); }

.toast-icon {
    font-size: 16px;
}

.toast-msg {
    font-size: 13px;
    font-weight: 500;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
    .charts-row {
        grid-template-columns: 1fr;
    }
    .team-management-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .close-sidebar-btn {
        display: block;
    }
    .toggle-sidebar-btn {
        display: block;
    }
    .kanban-board {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
}
