/* ============================================
   ROOT & COLORS
   ============================================ */
:root {
    --primary-color: #e67e22;
    --primary-dark: #d35400;
    --secondary-color: #9b59b6;
    --text-color: #2c3e50;
    --text-muted: #7f8c8d;
    --background-color: #ecf0f1;
    --border-color: #bdc3c7;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    height: 100%;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #e67e22 0%, #9b59b6 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h1 {
    color: #e67e22;
    margin-bottom: 5px;
    font-size: 2rem;
}

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

/* ============================================
   APP LAYOUT
   ============================================ */
.app-layout {
    display: flex;
    height: 100vh;
    background-color: var(--background-color);
}

.sidebar {
    width: 200px;
    background: linear-gradient(180deg, #e67e22 0%, #9b59b6 100%);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.sidebar-header {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.sidebar-nav a {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 15px;
    border-radius: 4px;
    transition: all 0.3s;
    display: block;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 15px;
}

.sidebar-footer a {
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 15px;
    border-radius: 4px;
    display: block;
    transition: all 0.3s;
}

.sidebar-footer a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
}

.sidebar .hidden {
    display: none;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 1.8rem;
    margin: 0;
    color: var(--text-color);
}

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

.role-badge {
    background: linear-gradient(90deg, #e67e22, #9b59b6);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.user-name {
    color: var(--text-muted);
    font-weight: 500;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    min-width: 0;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */
.form-group {
    margin-bottom: 18px;
}

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

.form-group label .required {
    color: #e74c3c;
}

.form-group input,
.form-group textarea,
.form-group select,
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background-color: #fff;
    color: var(--text-color);
}

.form-group input::placeholder,
input::placeholder {
    color: #bdc3c7;
}

.form-group input:hover,
input:hover,
.form-group select:hover,
select:hover,
.form-group textarea:hover,
textarea:hover {
    border-color: #a9a9a9;
    background-color: #fafafa;
}

.form-group input:focus,
input:focus,
.form-group textarea:focus,
textarea:focus,
.form-group select:focus,
select:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.15);
    background-color: #fff;
}

.form-group input:disabled,
input:disabled,
.form-group select:disabled,
select:disabled,
.form-group textarea:disabled,
textarea:disabled {
    background-color: #ecf0f1;
    border-color: #bdc3c7;
    color: #7f8c8d;
    cursor: not-allowed;
}

.form-group input:invalid:focus,
input:invalid:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

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

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
    cursor: pointer;
}

.form-group input[type="checkbox"],
input[type="checkbox"],
.form-group input[type="radio"],
input[type="radio"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

.form-error {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 4px;
    display: none;
}

.form-group.error .form-error {
    display: block;
}

.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: #e74c3c;
}

.form-hint {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 4px;
}

/* ============================================
   BUTTONS
   ============================================ */
button {
    font-family: inherit;
    cursor: pointer;
}

.btn,
.primary-btn,
.secondary-btn,
.danger,
button[type="submit"] {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn:disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary,
.primary-btn,
button[type="submit"] {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.3);
}

.btn-primary:hover:not(:disabled),
.primary-btn:hover:not(:disabled),
button[type="submit"]:hover:not(:disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
}

.btn-primary:active:not(:disabled),
.primary-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(230, 126, 34, 0.3);
}

.btn-secondary,
.secondary-btn {
    background-color: #ecf0f1;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover:not(:disabled),
.secondary-btn:hover:not(:disabled) {
    background-color: #bdc3c7;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-danger,
.danger {
    background-color: var(--danger);
    color: white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover:not(:disabled),
.danger:hover:not(:disabled) {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.btn-success {
    background-color: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.btn-success:hover:not(:disabled) {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

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

.btn-outline:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-large {
    padding: 12px 24px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   ALERTS & MESSAGES
   ============================================ */
.alert,
.message-box {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideDown 0.3s ease-out;
    border-left: 4px solid;
}

.alert.hidden,
.message-box.hidden {
    display: none !important;
}

.alert-error,
.message-box.error {
    background-color: #fadbd8;
    color: #c0392b;
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.08), rgba(231, 76, 60, 0.02));
}

.alert-success,
.message-box.success {
    background-color: #d5f5e3;
    color: #196f3d;
    border-left-color: #27ae60;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.08), rgba(39, 174, 96, 0.02));
}

.alert-warning {
    background-color: #fef9e7;
    color: #7d6608;
    border-left-color: #f39c12;
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.08), rgba(243, 156, 18, 0.02));
}

.alert-info {
    background-color: #ebf5fb;
    color: #154360;
    border-left-color: #3498db;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(52, 152, 219, 0.02));
}

.alert-icon,
.message-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-title,
.message-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-message,
.message-content {
    font-size: 0.9rem;
    line-height: 1.4;
}

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

/* ============================================
   CARDS & LAYOUT
   ============================================ */
.card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

/* ============================================
   TABLES
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

table tr:hover {
    background-color: #f8f9fa;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.badge-priority-high { background-color: #fadbd8; color: #c0392b; }
.badge-priority-medium { background-color: #fef9e7; color: #f39c12; }
.badge-priority-low { background-color: #e8f8f5; color: #27ae60; }

.badge-status-lead { background-color: #ebf5fb; color: #2980b9; }
.badge-status-contacted { background-color: #d6eaf8; color: #2471a3; }
.badge-status-proposal { background-color: #fcf3cf; color: #d68910; }
.badge-status-negotiation { background-color: #fae5d3; color: #d35400; }
.badge-status-closed { background-color: #d5f5e3; color: #196f3d; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-overlay[style*="display: flex"],
.modal-overlay.show {
    display: flex !important;
}

.modal {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    margin: auto;
    animation: slideUp 0.3s ease-out;
}

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

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

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

.modal-header h2,
.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

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

.modal-content {
    min-height: auto;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-actions,
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.modal-actions .btn {
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed var(--border-color);
}

.empty-state h3 { color: var(--text-muted); margin-bottom: 15px; }

/* Tasks */
.task-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    cursor: pointer;
}

.task-content {
    flex-grow: 1;
}

.task-desc {
    font-weight: 500;
    margin-bottom: 5px;
}

.task-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
}

.task-completed .task-desc {
    text-decoration: line-through;
    color: var(--text-muted);
}

.delete-task-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    opacity: 0.6;
    font-size: 1.2rem;
}

.delete-task-btn:hover {
    opacity: 1;
}

/* Meetings */
.meeting-item {
    background: white;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-left: 4px solid #e67e22;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meeting-info h4 {
    margin: 0 0 5px 0;
}

.meeting-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
}

.meeting-status {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-scheduled { background: #e8f6f3; color: #1abc9c; }
.status-completed { background: #eaeded; color: #7f8c8d; }
.status-cancelled { background: #fadbd8; color: #e74c3c; }
.status-noshow { background: #fdedec; color: #c0392b; }

/* Sales Team */
.sales-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.team-member-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    position: relative;
    transition: box-shadow 0.2s;
}

.team-member-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.member-role {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f0f3f5;
    color: var(--text-color);
}

.member-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
    margin-right: 60px; /* Space for role badge */
}

.member-email {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: block;
}

.member-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-active { background-color: #2ecc71; }
.status-inactive { background-color: #95a5a6; }

.member-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 4px;
}

.icon-btn:hover {
    color: #e67e22;
}

.icon-btn.delete-btn:hover {
    color: #e74c3c;
}

/* Activity Table */
.activity-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.activity-table th, .activity-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.activity-table th {
    background-color: #f8f9fa;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.activity-table tr:hover {
    background-color: #f8f9fa;
}

.metric-cell {
    font-family: monospace;
    font-size: 1rem;
    font-weight: 600;
}

/* Training */
.training-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

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

.training-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.training-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.attendance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.status-toggle {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    background: #e0e0e0;
}

.status-present { background: #d5f5e3; color: #196f3d; }
.status-absent { background: #fadbd8; color: #c0392b; }
.status-excused { background: #fcf3cf; color: #d68910; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        height: auto;
        padding: 10px;
    }

    .sidebar-header {
        margin-bottom: 0;
        margin-right: 20px;
        border-bottom: none;
        border-right: 2px solid rgba(255, 255, 255, 0.2);
        padding-bottom: 0;
        padding-right: 15px;
    }

    .sidebar-nav {
        flex-direction: row;
        flex: 1;
        gap: 5px;
    }

    .sidebar-nav a {
        padding: 8px 12px;
    }

    .sidebar-footer {
        border-top: none;
        border-left: 2px solid rgba(255, 255, 255, 0.2);
        padding-top: 0;
        padding-left: 15px;
        margin-left: auto;
    }

    .sidebar-footer a {
        padding: 8px 12px;
    }

    .content-area {
        padding: 20px;
    }

    .modal {
        max-width: 90vw;
        max-height: 80vh;
    }

    .sales-team-grid {
        grid-template-columns: 1fr;
    }

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

/* ============================================
   DASHBOARD STYLING
   ============================================ */

.dashboard-header {
    margin-bottom: 30px;
    animation: slideDown 0.5s ease;
}

.dashboard-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card-stat {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
}

.card-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
}

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

.card-stat-clients::before {
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.card-stat-tasks::before {
    background: linear-gradient(90deg, #27ae60, #229954);
}

.card-stat-conversions::before {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.card-stat-rate::before {
    background: linear-gradient(90deg, #f39c12, #d68910);
}

.stat-icon {
    font-size: 2.5rem;
    line-height: 1;
    min-width: 60px;
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 8px;
}

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

/* Section Headers */
.dashboard-section {
    margin-bottom: 40px;
}

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

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Card Elevated */
.card-elevated {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #f0f0f0;
    background: white;
    transition: all 0.3s ease;
}

.card-elevated:hover {
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
}

/* Task Items */
#upcoming-tasks > div {
    padding: 15px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 10px;
    background: linear-gradient(90deg, rgba(230, 126, 34, 0.05), transparent);
    border-radius: 4px;
    transition: all 0.3s ease;
}

#upcoming-tasks > div:hover {
    background: linear-gradient(90deg, rgba(230, 126, 34, 0.1), transparent);
    transform: translateX(5px);
}

#upcoming-tasks > div strong {
    color: var(--text-color);
    font-size: 1.05rem;
    display: block;
    margin-bottom: 5px;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
        margin-bottom: 30px;
    }

    .card-stat {
        padding: 20px;
        gap: 15px;
    }

    .stat-icon {
        font-size: 2rem;
        min-width: 50px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .dashboard-header h2 {
        font-size: 1.4rem;
    }

    .section-header h2 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .app-layout {
        font-size: 14px;
    }

    .sidebar {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }

    .sidebar-header {
        margin-bottom: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        border-right: none;
        padding-bottom: 10px;
        padding-right: 0;
    }

    .sidebar-nav {
        flex-direction: column;
        gap: 5px;
    }

    .sidebar-footer {
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        border-left: none;
        padding-top: 10px;
        padding-left: 0;
        margin-left: 0;
    }

    .top-bar {
        flex-direction: column;
        gap: 10px;
        padding: 10px 20px;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .user-context {
        width: 100%;
        justify-content: space-between;
    }

    .content-area {
        padding: 15px;
    }

    .card {
        padding: 15px;
    }

    .modal {
        max-width: 95vw;
        max-height: 85vh;
        padding: 20px;
    }

    table {
        font-size: 0.8rem;
    }

    table th,
    table td {
        padding: 8px;
    }

    .primary-btn,
    .secondary-btn,
    .danger {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* Multi-select styling */
select[multiple] {
    appearance: none !important;
    background-image: none !important;
    padding-right: 10px !important;
}

select[multiple] option {
    padding: 8px;
    margin: 4px 0;
    background-color: white;
    color: var(--text-color);
}

select[multiple] option:checked {
    background-color: var(--primary-color) !important;
    background-image: linear-gradient(var(--primary-color), var(--primary-color)) !important;
    color: white !important;
}
