@import url("https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css");
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css");

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

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #9b59b6;
    --light-gray: #ecf0f1;
    --dark-gray: #7f8c8d;
    --white: #ffffff;
    --bg-color: #f5f6fa;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-color: #dee2e6;
    --border-radius: 8px;
    --sidebar-width: 250px;
    --header-height: 60px;
    
    /* Theme transition */
    --theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Light Theme (default) */
:root.theme-light,
:root:not(.theme-light):not(.theme-dark) {
    --bg-color: #f5f6fa;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-color: #dee2e6;
    --light-gray: #ecf0f1;
    --dark-gray: #7f8c8d;
    --white: #ffffff;
    --surface-color: #f3f4f6;
}

/* Dark Theme */
:root.theme-dark {
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #e4e4e4;
    --border-color: #3a3a5c;
    --light-gray: #2a2a4a;
    --dark-gray: #9ca3af;
    --white: #e4e4e4;
    --surface-color: #252545;
    --secondary-color: #a0aec0;
    
    /* Adjusted colors for dark theme */
    --primary-color: #4aa3df;
    --success-color: #2ecc71;
    --warning-color: #f5b041;
    --danger-color: #ec7063;
    --info-color: #af7ac5;
}

/* Apply transitions for theme switching */
body,
.navbar,
.task-card,
.stat-card,
.modal-content,
.form-group input,
.form-group select,
.form-group textarea,
.table th,
.table td,
.sidebar,
.topbar,
.info-panel,
.file-drop-zone,
.file-preview-item {
    transition: var(--theme-transition);
}

/* Dark theme specific adjustments */
:root.theme-dark .navbar {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
}

:root.theme-dark .login-container-wrapper {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d4a 100%);
}

:root.theme-dark .login-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

:root.theme-dark .table th {
    background-color: var(--surface-color);
    color: var(--dark-gray);
}

:root.theme-dark .table-hover tbody tr:hover {
    background-color: var(--surface-color);
}

:root.theme-dark .form-group input,
:root.theme-dark .form-group select,
:root.theme-dark .form-group textarea {
    background-color: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

:root.theme-dark .form-group input:focus,
:root.theme-dark .form-group select:focus,
:root.theme-dark .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 163, 223, 0.25);
}

:root.theme-dark .btn-secondary {
    background: #4a5568;
}

:root.theme-dark .btn-outline-secondary {
    color: var(--dark-gray);
    border-color: var(--border-color);
}

:root.theme-dark .btn-outline-secondary:hover {
    background: var(--surface-color);
    color: var(--text-color);
}

:root.theme-dark .subtask-item,
:root.theme-dark .note-item,
:root.theme-dark .chat-messages,
:root.theme-dark .chat-message {
    background: var(--surface-color);
}

:root.theme-dark .priority-btn {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--dark-gray);
}

:root.theme-dark .file-drop-zone {
    background: var(--card-bg);
    border-color: var(--border-color);
}

:root.theme-dark .file-drop-zone:hover {
    border-color: var(--primary-color);
    background: rgba(74, 163, 223, 0.05);
}

:root.theme-dark .modal {
    background-color: rgba(0, 0, 0, 0.7);
}

:root.theme-dark .close {
    color: var(--dark-gray);
}

:root.theme-dark .close:hover {
    color: var(--text-color);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Bootstrap Icons - Global Size */
h1 i.bi, h2 i.bi, h3 i.bi {
    font-size: 2.5rem;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
#loginScreen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-weight: 700;
}

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

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

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

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.error-message {
    color: var(--danger-color);
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Navigation */
.navbar {
    background: var(--primary-color);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-weight: 500;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: #fff;
    color: var(--primary-color);
    border-color: #fff;
}

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-2px);
}

.nav-link.active {
    background: #fff;
    color: var(--primary-color);
    border-color: #fff;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #fff;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

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

.btn-primary:hover {
    background: #0b5ed7;
}

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

.btn-secondary:hover {
    background: #5c636a;
}

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

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

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

.btn-outline-secondary:hover {
    background: var(--secondary-color);
    color: #fff;
}

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

.btn-lg {
    padding: 12px 20px;
    font-size: 1.1rem;
}

/* Views */
.view {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.4s ease-in;
}

.view.active {
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

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

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stats-grid .stat-card {
    color: #fff;
}

.stats-grid .stat-card:nth-child(1) {
    background: var(--warning-color);
    color: #000;
}

.stats-grid .stat-card:nth-child(2) {
    background: var(--info-color);
    color: #000;
}

.stats-grid .stat-card:nth-child(3) {
    background: var(--success-color);
}

.stats-grid .stat-card:nth-child(4) {
    background: var(--danger-color);
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.recent-tasks {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Calendar */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.calendar-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#calendarContainer {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
}

.calendar-weekly {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
}

.calendar-hour {
    background: var(--card-bg);
    padding: 0.5rem;
    font-size: 0.875rem;
    text-align: right;
    border-right: 2px solid var(--border-color);
}

.calendar-day {
    background: var(--card-bg);
    padding: 0.5rem;
    text-align: center;
    font-weight: 500;
    border-bottom: 2px solid var(--border-color);
}

.calendar-cell {
    background: var(--card-bg);
    min-height: 60px;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.calendar-task {
    position: absolute;
    left: 2px;
    right: 2px;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calendar-task:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.calendar-task.assigned {
    background: rgba(255, 193, 7, 0.25);
    border-left: 3px solid var(--warning-color);
}

.calendar-task.in_progress {
    background: rgba(13, 202, 240, 0.25);
    border-left: 3px solid var(--info-color);
}

.calendar-task.closed {
    background: rgba(25, 135, 84, 0.2);
    border-left: 3px solid var(--success-color);
}

/* Tasks List */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.task-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.task-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.task-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.task-status {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

.task-status.assigned {
    background: var(--warning-color);
    color: #000;
}

.task-status.in_progress {
    background: var(--info-color);
    color: #000;
}

.task-status.closed {
    background: var(--success-color);
    color: #fff;
}

.task-status.delayed {
    background: var(--danger-color);
    color: #fff;
}

.task-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--secondary-color);
    transition: color 0.2s ease;
}

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

/* Task Detail */
.task-detail-section {
    margin-bottom: 2rem;
}

.task-detail-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.subtask-item {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.notes-section {
    margin-top: 2rem;
}

.note-item {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.attachments-section {
    margin-top: 2rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.chat-section {
    margin-top: 2rem;
}

.chat-messages {
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: 6px;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.chat-input {
    display: flex;
    gap: 0.5rem;
}

.chat-input input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
}

.badge {
    padding: 6px 12px;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 999px;
}

.status-pending {
    background-color: var(--warning-color);
    color: #000;
}

.status-inprogress {
    background-color: var(--info-color);
    color: #000;
}

.status-completed {
    background-color: var(--success-color);
    color: #fff;
}

.status-delayed {
    background-color: var(--danger-color);
    color: #fff;
}

.status-cancelled {
    background-color: var(--secondary-color);
    color: #fff;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #6c757d;
    text-align: left;
    padding: 12px;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

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

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        width: 100%;
        justify-content: center;
    }

    .view {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .calendar-weekly {
        grid-template-columns: 60px repeat(7, 1fr);
        font-size: 0.75rem;
    }

    .modal-content {
        padding: 1rem;
        margin: 1rem;
    }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Notification System Styles */
.notification-container {
    position: relative;
    display: inline-block;
    margin-right: 1rem;
}

.notification-bell {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    padding: 0.25rem;
    transition: transform 0.2s ease;
    color: #fff;
}

.notification-bell:hover {
    transform: scale(1.1);
}

.notification-bell.has-notifications {
    animation: bellRing 0.5s ease-in-out infinite;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-15deg); }
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.notification-popup {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    max-height: 400px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

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

.notification-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
    line-height: 1;
}

.notification-close:hover {
    color: var(--danger-color);
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.notification-item:last-child {
    border-bottom: none;
}

.notification-item .notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.notification-item .notification-message {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}

.notification-item .notification-time {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.notification-item.new-assignment .notification-title {
    color: var(--primary-color);
}

.notification-item.starting-soon .notification-title {
    color: var(--warning-color);
}

.notification-item.tomorrow .notification-title {
    color: var(--success-color);
}

.no-notifications {
    padding: 2rem;
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* ========================================
   ENHANCED FORM STYLING (Corrective Maintenance Style)
   ======================================== */

.form-section {
    margin-bottom: var(--spacing-lg, 24px);
    padding-bottom: var(--spacing-md, 16px);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.form-section:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color, #3498db);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-md, 16px);
    display: flex;
    align-items: center;
}

.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary-color, #3498db);
    border-radius: 50%;
    color: white;
    font-size: 12px;
    font-weight: 700;
    margin-right: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md, 16px);
    margin-bottom: var(--spacing-md, 16px);
}

.form-row.full {
    grid-template-columns: 1fr;
}

.form-row.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

.hint {
    font-size: 0.85rem;
    color: var(--secondary-color, #6b7280);
    margin-top: 4px;
}

.required {
    color: var(--danger-color, #e74c3c);
    font-weight: 700;
}

/* Priority Selector Buttons - Radio Button Style */
.priority-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.priority-btn {
    padding: 12px 8px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-align: center;
    background: #ecf0f1;
    color: #7f8c8d;
    position: relative;
    overflow: hidden;
}

/* Default hover effect for unselected buttons */
.priority-btn:hover {
    transform: scale(1.05);
}

/* P1 Critical hover effect */
.priority-btn.critical:hover:not(.active) {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5), inset 0 0 10px rgba(231, 76, 60, 0.1);
    animation: pulse-critical 1s infinite;
}

/* P2 High hover effect */
.priority-btn.high:hover:not(.active) {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.15);
    color: #f39c12;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.5), inset 0 0 10px rgba(243, 156, 18, 0.1);
    animation: pulse-high 1s infinite;
}

/* P3 Medium hover effect */
.priority-btn.medium:hover:not(.active) {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.5), inset 0 0 10px rgba(52, 152, 219, 0.1);
    animation: pulse-medium 1s infinite;
}

/* P4 Low hover effect */
.priority-btn.low:hover:not(.active) {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.5), inset 0 0 10px rgba(39, 174, 96, 0.1);
    animation: pulse-low 1s infinite;
}

/* Pulse animations for each priority */
@keyframes pulse-critical {
    0%, 100% { box-shadow: 0 0 20px rgba(231, 76, 60, 0.5); }
    50% { box-shadow: 0 0 30px rgba(231, 76, 60, 0.8); }
}

@keyframes pulse-high {
    0%, 100% { box-shadow: 0 0 20px rgba(243, 156, 18, 0.5); }
    50% { box-shadow: 0 0 30px rgba(243, 156, 18, 0.8); }
}

@keyframes pulse-medium {
    0%, 100% { box-shadow: 0 0 20px rgba(52, 152, 219, 0.5); }
    50% { box-shadow: 0 0 30px rgba(52, 152, 219, 0.8); }
}

@keyframes pulse-low {
    0%, 100% { box-shadow: 0 0 20px rgba(39, 174, 96, 0.5); }
    50% { box-shadow: 0 0 30px rgba(39, 174, 96, 0.8); }
}

/* Active/Selected states - full color */
.priority-btn.active {
    transform: scale(1.05);
}

.priority-btn.critical.active {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
    animation: pulse-critical 2s infinite;
}

.priority-btn.high.active {
    background: #f39c12;
    border-color: #f39c12;
    color: white;
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.6);
    animation: pulse-high 2s infinite;
}

.priority-btn.medium.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
    animation: pulse-medium 2s infinite;
}

.priority-btn.low.active {
    background: #27ae60;
    border-color: #27ae60;
    color: white;
    box-shadow: 0 0 15px rgba(39, 174, 96, 0.6);
    animation: pulse-low 2s infinite;
}

/* Legacy classes for compatibility */
.priority-btn.p1 { background: #e74c3c; border-color: #e74c3c; color: white; }
.priority-btn.p2 { background: #f39c12; border-color: #f39c12; color: white; }
.priority-btn.p3 { background: #3498db; border-color: #3498db; color: white; }
.priority-btn.p4 { background: #27ae60; border-color: #27ae60; color: white; }

/* Severity Slider */
.severity-slider {
    display: flex;
    gap: 16px;
    align-items: center;
}

.severity-slider input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--surface-color, #f3f4f6);
    outline: none;
    -webkit-appearance: none;
}

.severity-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color, #3498db);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.severity-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color, #3498db);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color, #3498db);
}

.checkbox-item label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

/* Info Panel (Sidebar) */
.info-panel {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color, #e5e7eb);
    margin-bottom: 16px;
}

.info-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color, #1f2937);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--surface-color, #f3f4f6);
    font-size: 0.9rem;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--secondary-color, #6b7280);
}

.info-value {
    font-weight: 600;
    color: var(--text-color, #1f2937);
}

/* Alert Boxes */
.alert {
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 16px;
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    border-left-color: var(--primary-color, #3498db);
    color: #2980b9;
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    border-left-color: var(--warning-color, #f39c12);
    color: #b45309;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    border-left-color: var(--success-color, #27ae60);
    color: #059669;
}

/* Success Message Toast */
.success-message {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color, #27ae60);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

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

/* Responsive Form */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-row.three-col {
        grid-template-columns: 1fr;
    }

    .priority-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================
   DRAG-AND-DROP FILE UPLOAD COMPONENT
   =================================== */

.file-upload-section {
    margin-bottom: 1.5rem;
}

.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--card-bg);
    cursor: pointer;
}

.file-drop-zone:hover {
    border-color: var(--primary-color);
    background: rgba(52, 152, 219, 0.02);
}

.file-drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(52, 152, 219, 0.05);
    border-width: 3px;
    transform: scale(1.01);
}

.file-drop-zone i.bi {
    display: block;
    margin-bottom: 1rem;
}

.file-drop-zone p {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: var(--text-color);
}

.file-drop-zone .hint {
    font-size: 0.875rem;
    color: var(--dark-gray);
}

.file-drop-zone .link-text {
    color: var(--primary-color);
    font-weight: 600;
}

/* File Preview List */
.file-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.file-preview-item {
    position: relative;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.file-preview-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.file-preview-item.upload-success {
    border-color: var(--success-color);
    background: rgba(39, 174, 96, 0.05);
}

.file-preview-item.upload-error {
    border-color: var(--danger-color);
    background: rgba(231, 76, 60, 0.05);
}

.file-preview-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.file-preview-info {
    flex: 1;
    overflow: hidden;
}

.file-preview-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.file-preview-size {
    font-size: 0.75rem;
    color: var(--dark-gray);
}

.file-preview-item .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.file-preview-item .remove-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.file-preview-item .remove-btn i {
    font-size: 0.75rem;
}

/* Upload Progress */
.upload-progress {
    height: 4px;
    background: var(--light-gray);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.upload-progress-bar {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s ease;
    width: 0%;
}

/* File Upload Toast Notifications */
.file-upload-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--danger-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
}

.file-upload-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.file-upload-toast.error {
    background: var(--danger-color);
}

.file-upload-toast.success {
    background: var(--success-color);
}

.file-upload-toast i.bi {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Responsive File Upload */
@media (max-width: 768px) {
    .file-drop-zone {
        padding: 1.5rem 1rem;
    }

    .file-drop-zone i.bi {
        font-size: 2rem !important;
    }

    .file-preview-list {
        grid-template-columns: 1fr;
    }

    .file-upload-toast {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}

