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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Container */
.container {
    display: flex;
    min-height: 100vh;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-left h1 {
    color: #007bff;
    font-size: 1.5rem;
    font-weight: 600;
}

.header-left h1 i {
    margin-right: 8px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu span {
    color: #666;
    font-size: 0.9rem;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 250px;
    height: calc(100vh - 60px);
    background: #fff;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
    z-index: 999;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: #f8f9fa;
    color: #007bff;
    border-left-color: #007bff;
}

.nav-menu a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    margin-top: 60px;
    padding: 20px;
    background: #f8f9fa;
    min-height: calc(100vh - 60px);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.page-header h2 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 4px 8px;
    font-size: 0.8rem;
}

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

/* Forms */
.form {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.table tr:hover {
    background: #f8f9fa;
}

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

/* Status and Priority Badges */
.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-in_progress {
    background: #d1ecf1;
    color: #0c5460;
}

.status-review {
    background: #e2d9f3;
    color: #6f42c1;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.priority {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.priority-low {
    background: #d4edda;
    color: #155724;
}

.priority-medium {
    background: #fff3cd;
    color: #856404;
}

.priority-high {
    background: #f8d7da;
    color: #721c24;
}

.priority-critical {
    background: #f8d7da;
    color: #721c24;
    font-weight: 700;
}

.role {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.role-admin {
    background: #dc3545;
    color: #fff;
}

.role-manager {
    background: #fd7e14;
    color: #fff;
}

.role-developer {
    background: #007bff;
    color: #fff;
}

.role-tester {
    background: #28a745;
    color: #fff;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 5px;
}

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

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #007bff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-content p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Charts */
.charts-section {
    margin-bottom: 30px;
}

.chart-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.chart-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Recent Activity */
.activity-list {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007bff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.activity-content h4 {
    margin-bottom: 5px;
    color: #333;
    font-size: 1rem;
}

.activity-content p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.activity-content small {
    color: #999;
    font-size: 0.8rem;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #007bff;
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.input-group input {
    padding-left: 40px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.login-footer p {
    color: #666;
    font-size: 0.8rem;
}

/* Project View */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.project-actions {
    display: flex;
    gap: 10px;
}

.project-info {
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-start;
}

.info-row strong {
    width: 120px;
    color: #333;
    font-weight: 600;
}

.info-row span,
.info-row p {
    flex: 1;
    color: #666;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: #007bff;
    transition: width 0.3s ease;
}

/* No Data */
.no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

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

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

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

    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .project-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .project-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Utility Classes */
.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.text-muted {
    color: #666;
}

.text-success {
    color: #28a745;
}

.text-danger {
    color: #dc3545;
}

.text-warning {
    color: #ffc107;
}

.text-info {
    color: #17a2b8;
}

/* Message System Styles */
.message-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.message-nav .btn {
    flex: 1;
    max-width: 200px;
}

.comments-list {
    list-style: none;
    padding: 0;
}

.comments-list li {
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #fff;
}

.comments-list li:last-child {
    margin-bottom: 0;
}

.message-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.message-content {
    line-height: 1.6;
    margin-bottom: 20px;
}

.message-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Badge for unread messages */
.badge {
    background: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 5px;
}

/* Dashboard Styles */
.header-actions {
    display: flex;
    gap: 10px;
}

.quick-actions {
    margin: 30px 0;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    text-align: center;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
    color: #007bff;
}

.action-card i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #007bff;
}

.action-card span {
    font-weight: 500;
}

.recent-section,
.projects-section {
    margin: 30px 0;
}

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

.section-header h3 {
    margin: 0;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.task-info h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}

.task-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

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

.project-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.project-progress {
    margin: 15px 0;
}

.project-progress span {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    display: block;
}

.project-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #666;
}

.admin-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

/* Dashboard visual enhancements */
:root {
    --tf-primary: #007bff;
    --tf-primary-dark: #0056b3;
    --tf-success: #28a745;
    --tf-warning: #ffc107;
    --tf-info: #17a2b8;
    --tf-danger: #dc3545;
    --tf-purple: #6f42c1;
}

.header {
    background: #ffffffcc;
    backdrop-filter: saturate(180%) blur(6px);
}

.card.elevated {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

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

.kpi-card {
    position: relative;
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.kpi-card .stat-icon {
    background: rgba(255, 255, 255, 0.2);
}

.kpi-card .stat-content h3,
.kpi-card .stat-content p {
    color: #fff;
}

.kpi-total {
    background: linear-gradient(135deg, var(--tf-primary) 0%, var(--tf-primary-dark) 100%);
}

.kpi-pending {
    background: linear-gradient(135deg, #ffb302 0%, #ff8800 100%);
}

.kpi-inprogress {
    background: linear-gradient(135deg, var(--tf-info) 0%, #0f7c8f 100%);
}

.kpi-completed {
    background: linear-gradient(135deg, var(--tf-success) 0%, #1d7a35 100%);
}

/* Quick actions polish */
.action-card {
    border: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.action-card i {
    color: var(--tf-primary);
}

/* Project cards polish */
.project-card {
    border: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.12);
}

/* Section header underline accent */
.section-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
}

.section-header h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--tf-primary);
    border-radius: 2px;
    margin-top: 8px;
}

/* Recent task items */
.task-item {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Admin stats cards */
.admin-section .stat-card {
    border: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

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

/* Responsive adjustments for new elements */
@media (max-width: 768px) {
    .message-nav {
        flex-direction: column;
    }

    .message-nav .btn {
        max-width: none;
    }

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

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

    .task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-actions {
        flex-direction: column;
        gap: 5px;
    }
}