/* Panel Styles - BD Rising */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #333;
}

/* Auth Pages Styles */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
}

.auth-box h2 {
    text-align: center;
    color: #1a1a2e;
    margin-bottom: 8px;
    font-size: 28px;
}

.auth-box .subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0f3460;
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #0f3460, #16213e);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(15, 52, 96, 0.4);
}

.btn-secondary {
    background: #e1e1e1;
    color: #333;
}

.btn-secondary:hover {
    background: #d1d1d1;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
}

/* Alert Styles */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-error {
    background: #ffe6e6;
    color: #c0392b;
    border-left: 4px solid #e74c3c;
}

.alert-success {
    background: #e6ffe6;
    color: #27ae60;
    border-left: 4px solid #2ecc71;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-link a {
    color: #0f3460;
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

.demo-credentials {
    margin-top: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    color: #666;
}

.demo-credentials p {
    margin: 3px 0;
}

/* Panel Layout */
.panel-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f3460 0%, #16213e 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.admin-sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f3460 100%);
}

.contributor-sidebar {
    background: linear-gradient(180deg, #145a32 0%, #27ae60 100%);
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 24px;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 14px;
    opacity: 0.8;
}

.sidebar-nav {
    padding: 20px 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #e94560;
}

.nav-item .icon {
    margin-right: 12px;
    font-size: 18px;
}

.nav-item.logout {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-badge {
    background: #e94560;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: auto;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 30px;
    background: #f5f6fa;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.content-header {
    margin-bottom: 30px;
}

.content-header h1 {
    color: #1a1a2e;
    font-size: 28px;
    margin-bottom: 8px;
}

.content-header p {
    color: #666;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: #1a1a2e;
    font-size: 18px;
}

.card-body {
    padding: 25px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 40px;
    margin-right: 20px;
}

.stat-info h3 {
    font-size: 32px;
    color: #1a1a2e;
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 14px;
}

.stat-card.pending {
    border-left: 4px solid #f1c40f;
}

.stat-card.success {
    border-left: 4px solid #2ecc71;
}

.stat-card.users {
    border-left: 4px solid #3498db;
}

/* Message List */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-item {
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.message-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.message-item.pending {
    border-left: 4px solid #f1c40f;
}

.message-item.replied {
    border-left: 4px solid #2ecc71;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.message-header h4 {
    color: #1a1a2e;
    font-size: 16px;
}

.message-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.message-text {
    color: #444;
    line-height: 1.6;
    margin-bottom: 10px;
}

.message-date {
    color: #999;
    font-size: 12px;
}

.message-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-replied {
    background: #d4edda;
    color: #155724;
}

/* Reply Section */
.replies-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.replies-section h5 {
    color: #0f3460;
    margin-bottom: 10px;
    font-size: 14px;
}

.reply-item {
    background: #e8f4fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid #3498db;
}

.reply-item p {
    color: #333;
    margin-bottom: 8px;
}

.reply-item small {
    color: #666;
    font-size: 12px;
}

/* Reply Form */
.reply-form {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.reply-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    margin-bottom: 10px;
    resize: vertical;
}

.reply-form textarea:focus {
    outline: none;
    border-color: #0f3460;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 10px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    color: #1a1a2e;
    font-weight: 600;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state p {
    margin-bottom: 20px;
}

/* Section Display */
.panel-section {
    display: none;
}

.panel-section.active {
    display: block;
}

/* Utility Classes */
.mt-20 {
    margin-top: 20px;
}

/* Old Responsive Design - Replaced by comprehensive mobile styles below */
/* See "COMPREHENSIVE RESPONSIVE DESIGN" section for mobile/tablet styles */

/* File Upload Styles */
.file-upload-wrapper {
    border: 2px dashed #d1d1d1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.file-upload-wrapper:hover {
    border-color: #0f3460;
    background: #f8f9fa;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
}

.file-upload-info .icon {
    font-size: 24px;
}

.file-preview {
    margin-top: 15px;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
}

.preview-item img,
.preview-item video {
    max-width: 120px;
    max-height: 80px;
    border-radius: 4px;
    object-fit: cover;
}

.preview-item audio {
    max-width: 200px;
}

.preview-info {
    flex: 1;
    font-size: 13px;
    color: #666;
}

.remove-preview {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.file-error {
    color: #e74c3c;
    padding: 10px;
    background: #ffe6e6;
    border-radius: 8px;
}

/* Attachment Styles */
.attachments-section {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.attachments-section h5 {
    margin-bottom: 10px;
    color: #0f3460;
    font-size: 14px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #eee;
}

.attachment-preview {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    object-fit: cover;
}

.attachment-audio {
    width: 100%;
    max-width: 300px;
}

.attachment-name {
    font-size: 12px;
    color: #666;
    word-break: break-all;
}

/* Conversation Thread Styles */
.conversation-thread {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.conversation-thread h5 {
    margin-bottom: 15px;
    color: #0f3460;
    font-size: 14px;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.chat-message.admin-message {
    align-items: flex-start;
}

.chat-message.user-message {
    align-items: flex-end;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    word-wrap: break-word;
}

.admin-message .chat-bubble {
    background: #e8f4fd;
    border-bottom-left-radius: 4px;
}

.user-message .chat-bubble {
    background: #d4edda;
    border-bottom-right-radius: 4px;
}

.contributor-message .chat-bubble {
    background: #d5f5e3;
    border-bottom-left-radius: 4px;
}

.chat-message.contributor-message {
    align-items: flex-start;
}

.chat-bubble p {
    margin: 0;
    color: #333;
    line-height: 1.5;
}

.chat-attachment {
    margin-top: 10px;
}

.chat-attachment img,
.chat-attachment video {
    max-width: 250px;
    border-radius: 8px;
}

.chat-attachment audio {
    width: 100%;
    max-width: 250px;
}

.chat-meta {
    margin-top: 5px;
    font-size: 11px;
    color: #999;
}

/* Chat Reply Form */
.chat-reply-form {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input-wrapper textarea {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 20px;
    resize: none;
    font-size: 14px;
    min-height: 40px;
}

.chat-input-wrapper textarea:focus {
    outline: none;
    border-color: #0f3460;
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-attach-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.file-attach-btn:hover {
    background: #e1e1e1;
}

.file-attach-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}

.file-attach-label:hover {
    background: #e1e1e1;
}

.file-attach-label input[type="file"] {
    display: none;
}

/* Tracking Styles */
.tracking-timeline {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.tracking-timeline h5 {
    margin-bottom: 10px;
    color: #0f3460;
    font-size: 13px;
}

.timeline-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: white;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid #eee;
}

.timeline-status {
    font-weight: 600;
    color: #0f3460;
}

.timeline-date {
    color: #999;
}

/* User Tracking Timeline - Vertical Style */
.user-tracking {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border: 1px solid #dde1e7;
}

.user-tracking summary {
    padding: 12px 15px;
    cursor: pointer;
    font-weight: 600;
    color: #0f3460;
    font-size: 14px;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-tracking summary::-webkit-details-marker {
    display: none;
}

.user-tracking summary::after {
    content: '▼';
    font-size: 10px;
    transition: transform 0.3s;
}

.user-tracking details[open] summary::after {
    transform: rotate(180deg);
}

.timeline-items-vertical {
    padding: 15px;
    position: relative;
}

.timeline-items-vertical::before {
    content: '';
    position: absolute;
    left: 25px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dde1e7;
}

.timeline-item-vertical {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
}

.timeline-item-vertical:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #999;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #dde1e7;
    flex-shrink: 0;
    z-index: 1;
}

.timeline-dot.status-received {
    background: #6c757d;
}

.timeline-dot.status-under_review {
    background: #3498db;
}

.timeline-dot.status-in_progress {
    background: #f39c12;
}

.timeline-dot.status-action_required {
    background: #e74c3c;
}

.timeline-dot.status-pending_approval {
    background: #9b59b6;
}

.timeline-dot.status-completed {
    background: #27ae60;
}

.timeline-dot.status-closed {
    background: #95a5a6;
}

.timeline-content {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    flex: 1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.timeline-content .timeline-status {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
}

.timeline-notes {
    color: #666;
    font-size: 13px;
    margin: 8px 0;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #3498db;
}

.timeline-meta {
    color: #999;
    font-size: 11px;
    display: block;
}

.tracking-update-section {
    margin-top: 15px;
}

.tracking-update-section details {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.tracking-update-section summary {
    padding: 12px 15px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 500;
    color: #666;
}

.tracking-update-section summary:hover {
    background: #eee;
}

.tracking-form {
    padding: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group select,
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.form-group select:focus,
.form-select:focus {
    outline: none;
    border-color: #0f3460;
}

.form-group select:disabled,
.form-select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Tracking Stats Grid */
.tracking-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.tracking-stat-card {
    padding: 15px;
    background: white;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tracking-stat-card.status-received { border-left-color: #9b59b6; }
.tracking-stat-card.status-under_review { border-left-color: #3498db; }
.tracking-stat-card.status-in_progress { border-left-color: #f1c40f; }
.tracking-stat-card.status-awaiting_response { border-left-color: #e67e22; }
.tracking-stat-card.status-escalated { border-left-color: #e74c3c; }
.tracking-stat-card.status-resolved { border-left-color: #2ecc71; }
.tracking-stat-card.status-closed { border-left-color: #95a5a6; }

.tracking-count {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
}

.tracking-label {
    font-size: 12px;
    color: #666;
}

.tracking-history h4 {
    margin-bottom: 15px;
    color: #1a1a2e;
}

.tracking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tracking-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

.tracking-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tracking-notes {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

/* Badge Styles for Tracking */
.badge-tracking {
    background: #e8f4fd;
    color: #0f3460;
}

.badge-priority-low { background: #e1e1e1; color: #666; }
.badge-priority-normal { background: #d4edda; color: #155724; }
.badge-priority-high { background: #fff3cd; color: #856404; }
.badge-priority-urgent { background: #f8d7da; color: #721c24; }

.badge-tracking-received { background: #e8d4f8; color: #6c3483; }
.badge-tracking-under_review { background: #d6eaf8; color: #1a5276; }
.badge-tracking-in_progress { background: #fef9e7; color: #9a7d0a; }
.badge-tracking-awaiting_response { background: #fdebd0; color: #935116; }
.badge-tracking-escalated { background: #fadbd8; color: #922b21; }
.badge-tracking-resolved { background: #d5f5e3; color: #196f3d; }
.badge-tracking-closed { background: #e5e8e8; color: #566573; }

/* Message Item Urgent */
.message-item.urgent {
    border-left: 4px solid #e74c3c;
    background: #fff8f8;
}

/* Message Badges */
.message-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Responsive adjustments for new features */
@media (max-width: 768px) {
    .chat-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chat-actions {
        justify-content: flex-end;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .tracking-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .attachment-preview {
        max-width: 150px;
    }
    
    .chat-bubble {
        max-width: 95%;
    }
}

/* User Management Styles */
.user-form-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid #eee;
}

.user-form-section h4 {
    margin-bottom: 20px;
    color: #1a1a2e;
    padding-bottom: 10px;
    border-bottom: 2px solid #0f3460;
}

.user-form {
    max-width: 100%;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.admin-row {
    background: #f0f7ff !important;
}

.contributor-row {
    background: #f0fff0 !important;
}

.badge-admin {
    background: linear-gradient(135deg, #0f3460, #16213e);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    margin-left: 5px;
}

.badge-contributor {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    margin-left: 5px;
}

.badge-user {
    background: #e8f4fd;
    color: #0f3460;
}

.badge-you {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    margin-left: 5px;
}

.stat-card.contributors {
    border-left: 4px solid #27ae60;
}

.btn-warning {
    background: #f1c40f;
    color: #333;
}

.btn-warning:hover {
    background: #d4ac0d;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    color: #1a1a2e;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-info {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.modal-info strong {
    color: #0f3460;
}

/* Data Table Improvements */
.data-table th:last-child,
.data-table td:last-child {
    text-align: center;
    white-space: nowrap;
}

.data-table .btn {
    padding: 5px 10px;
    font-size: 14px;
}

/* Responsive Modal */
@media (max-width: 480px) {
    .modal-content {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

/* Status Groups - Messages Grouped by Status */
.status-groups {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.status-group {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.status-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.3s ease;
    list-style: none;
}

.status-group-header::-webkit-details-marker {
    display: none;
}

.status-group-header::after {
    content: '▼';
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s;
    color: #666;
}

details[open] .status-group-header::after {
    transform: rotate(180deg);
}

.status-icon {
    font-size: 20px;
}

.status-count {
    background: rgba(0,0,0,0.1);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
}

/* Status Group Header Colors */
.status-group-header.status-received {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    color: #495057;
    border-bottom: 3px solid #6c757d;
}

.status-group-header.status-under_review {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    border-bottom: 3px solid #2196f3;
}

.status-group-header.status-in_progress {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
    border-bottom: 3px solid #ff9800;
}

.status-group-header.status-awaiting_response {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
    color: #c2185b;
    border-bottom: 3px solid #e91e63;
}

.status-group-header.status-escalated {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border-bottom: 3px solid #f44336;
}

.status-group-header.status-resolved {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border-bottom: 3px solid #4caf50;
}

.status-group-header.status-closed {
    background: linear-gradient(135deg, #eceff1 0%, #cfd8dc 100%);
    color: #546e7a;
    border-bottom: 3px solid #607d8b;
}

.status-group .message-list {
    padding: 15px;
    background: #fafafa;
}

.status-group .message-item {
    margin-bottom: 15px;
}

.status-group .message-item:last-child {
    margin-bottom: 0;
}

/* Status Group Hover Effects */
.status-group-header:hover {
    filter: brightness(0.95);
}

/* Empty Status Group Message */
.status-group-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Profile Section Styles */
.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.profile-picture-area {
    text-align: center;
}

.profile-picture-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e94560;
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.3);
}

.profile-picture-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e94560 0%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    font-weight: bold;
    color: white;
    border: 4px solid #0f3460;
    box-shadow: 0 5px 20px rgba(15, 52, 96, 0.3);
}

.profile-form {
    width: 100%;
    max-width: 500px;
}

.profile-form .form-group {
    margin-bottom: 20px;
}

.profile-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #0f3460;
}

.profile-form input[type="text"],
.profile-form input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.profile-form input[type="text"]:focus {
    border-color: #e94560;
    outline: none;
}

.profile-form input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #999;
}

.file-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.file-upload-wrapper input[type="file"] {
    padding: 10px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-wrapper input[type="file"]:hover {
    border-color: #e94560;
    background: #fff5f7;
}

.info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-label {
    font-weight: 500;
    color: #666;
}

/* Sidebar Profile */
.sidebar-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sidebar-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e94560;
}

.sidebar-avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e94560 0%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    color: white;
}

.sidebar-footer .sidebar-profile p {
    margin: 0;
    text-align: center;
}

/* Sidebar Storage Widget */
.sidebar-storage {
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: 100%;
}

.sidebar-storage-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-storage-header .storage-icon {
    font-size: 14px;
}

.sidebar-storage-header .storage-label {
    font-weight: 500;
}

.sidebar-storage-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.sidebar-storage-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.sidebar-storage-fill.storage-success {
    background: linear-gradient(90deg, #28a745, #34d058);
}

.sidebar-storage-fill.storage-warning {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.sidebar-storage-fill.storage-danger {
    background: linear-gradient(90deg, #dc3545, #e83e8c);
}

.sidebar-storage-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

/* Responsive Profile */
@media (max-width: 768px) {
    .profile-picture-large,
    .profile-picture-placeholder {
        width: 120px;
        height: 120px;
        font-size: 48px;
    }
    
    .profile-form {
        max-width: 100%;
    }
}

/* Profile Picture Preview */
.profile-picture-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.profile-preview-container {
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.profile-preview-container .profile-picture-large {
    border-color: #27ae60;
    box-shadow: 0 5px 20px rgba(39, 174, 96, 0.3);
}

.preview-label {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #27ae60;
    font-weight: 600;
    background: #e8f5e9;
    padding: 5px 15px;
    border-radius: 15px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#current-profile-pic,
#profile-placeholder {
    transition: opacity 0.3s ease;
}

/* ============================================
   COMPREHENSIVE RESPONSIVE DESIGN
   Mobile, Tablet, and Desktop Optimizations
   ============================================ */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #0f3460;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: #e94560;
}

.mobile-menu-toggle.active {
    background: #e94560;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* =============== TABLET STYLES (768px - 1024px) =============== */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
        padding: 25px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px 15px;
    }
    
    .stat-icon {
        font-size: 32px;
        margin-right: 15px;
    }
    
    .stat-info h3 {
        font-size: 26px;
    }
    
    .tracking-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .data-table {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
}

/* =============== MOBILE STYLES (max-width: 768px) =============== */
@media (max-width: 768px) {
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    /* Sidebar - Hidden by default on mobile */
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-header {
        padding: 20px 15px;
    }
    
    .sidebar-header h2 {
        display: block;
        font-size: 20px;
    }
    
    .sidebar-header p {
        display: block;
        font-size: 12px;
    }
    
    .sidebar-nav {
        display: block;
        padding: 15px 0;
    }
    
    .nav-item {
        display: flex;
        justify-content: flex-start;
        padding: 15px 20px;
        font-size: 15px;
    }
    
    .nav-item span:not(.icon) {
        display: inline;
    }
    
    .nav-item .icon {
        margin-right: 12px;
        font-size: 18px;
    }
    
    .sidebar-footer {
        display: block;
        padding: 15px;
    }
    
    /* Main Content - Full width on mobile */
    .main-content {
        margin-left: 0;
        padding: 70px 15px 20px 15px;
        width: 100%;
    }
    
    .content-header {
        text-align: center;
        padding: 15px 0;
    }
    
    .content-header h1 {
        font-size: 22px;
    }
    
    .content-header p {
        font-size: 13px;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        font-size: 30px;
        margin: 0 0 10px 0;
    }
    
    .stat-info h3 {
        font-size: 24px;
    }
    
    .stat-info p {
        font-size: 12px;
    }
    
    /* Cards */
    .card {
        border-radius: 12px;
        margin-bottom: 15px;
    }
    
    .card-header {
        padding: 15px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .card-header h3 {
        font-size: 16px;
        text-align: center;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* Filter Buttons */
    .filter-buttons {
        display: flex;
        width: 100%;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .filter-buttons .btn {
        flex: 1;
        min-width: calc(33% - 6px);
        text-align: center;
        padding: 10px 8px;
        font-size: 13px;
    }
    
    /* Message Items */
    .message-item {
        padding: 15px;
    }
    
    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .message-header h4 {
        font-size: 15px;
        word-break: break-word;
    }
    
    .message-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .badge {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .message-text {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .message-meta {
        font-size: 12px;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    /* Buttons */
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%;
    }
    
    .btn-sm {
        padding: 10px 15px;
    }
    
    .message-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .message-actions .btn {
        width: 100%;
    }
    
    /* Chat/Conversation */
    .conversation-thread {
        padding: 12px;
    }
    
    .chat-bubble {
        max-width: 90%;
        padding: 12px;
        font-size: 14px;
    }
    
    .chat-reply-form {
        margin-top: 15px;
    }
    
    .chat-input-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    
    .chat-input-wrapper textarea {
        font-size: 16px;
    }
    
    .chat-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .chat-actions .btn {
        flex: 1;
    }
    
    /* Tracking */
    .tracking-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .tracking-stat-card {
        padding: 12px 8px;
    }
    
    .tracking-count {
        font-size: 22px;
    }
    
    .tracking-label {
        font-size: 11px;
    }
    
    .tracking-timeline {
        padding: 10px;
    }
    
    .timeline-items-vertical {
        padding: 10px;
    }
    
    .timeline-content {
        padding: 10px 12px;
    }
    
    /* Status Groups */
    .status-group-header {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .status-icon {
        font-size: 18px;
    }
    
    .status-count {
        font-size: 12px;
        padding: 2px 8px;
    }
    
    /* Tables */
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
    
    /* Profile Section */
    .profile-section {
        gap: 20px;
    }
    
    .profile-picture-large,
    .profile-picture-placeholder {
        width: 120px;
        height: 120px;
        font-size: 48px;
    }
    
    .profile-form {
        width: 100%;
    }
    
    .info-grid {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Attachments */
    .attachment-preview {
        max-width: 100%;
        max-height: 200px;
    }
    
    .attachments-section {
        padding: 10px;
    }
    
    /* File Preview */
    .file-preview {
        max-width: 100%;
    }
    
    .preview-item img,
    .preview-item video {
        max-width: 100%;
        max-height: 200px;
    }
    
    /* User Management */
    .add-user-form {
        padding: 15px;
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        max-width: 400px;
        padding: 20px;
        margin: 10px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    /* Alert Messages */
    .alert {
        padding: 12px 15px;
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    /* Sidebar Profile on Mobile */
    .sidebar-profile {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 10px 15px;
        background: rgba(0,0,0,0.1);
        border-radius: 8px;
        margin: 10px 15px;
    }
    
    .sidebar-avatar,
    .sidebar-avatar-placeholder {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .sidebar-footer .sidebar-profile p {
        text-align: left;
        font-size: 13px;
    }
    
    /* Sidebar Storage on Mobile */
    .sidebar-storage {
        margin: 10px 15px;
        padding: 10px 12px;
    }
    
    .sidebar-storage-header {
        font-size: 11px;
    }
    
    .sidebar-storage-text {
        font-size: 10px;
    }
}

/* =============== SMALL MOBILE (max-width: 480px) =============== */
@media (max-width: 480px) {
    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: 10px;
        left: 10px;
    }
    
    .main-content {
        padding: 60px 10px 15px 10px;
    }
    
    .content-header h1 {
        font-size: 18px;
    }
    
    .content-header p {
        font-size: 12px;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        flex-direction: row;
        text-align: left;
        padding: 12px 15px;
    }
    
    .stat-icon {
        font-size: 28px;
        margin: 0 15px 0 0;
    }
    
    .stat-info h3 {
        font-size: 22px;
    }
    
    /* Cards */
    .card-header {
        padding: 12px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    /* Filter Buttons */
    .filter-buttons .btn {
        min-width: 100%;
        padding: 10px;
    }
    
    /* Messages */
    .message-item {
        padding: 12px;
        border-radius: 8px;
    }
    
    .message-header h4 {
        font-size: 14px;
    }
    
    .badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    /* Tracking */
    .tracking-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .tracking-count {
        font-size: 20px;
    }
    
    /* Profile */
    .profile-picture-large,
    .profile-picture-placeholder {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }
    
    /* Conversation */
    .chat-bubble {
        max-width: 95%;
        padding: 10px;
        font-size: 13px;
    }
    
    /* Status Groups */
    .status-group-header {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .status-group .message-list {
        padding: 10px;
    }
    
    /* Auth Box */
    .auth-box {
        padding: 25px 15px;
        border-radius: 12px;
    }
    
    .auth-box h2 {
        font-size: 22px;
    }
    
    /* Tables - Card view on very small screens */
    .data-table thead {
        display: none;
    }
    
    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }
    
    .data-table tr {
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 10px;
        background: #fafafa;
    }
    
    .data-table td {
        padding: 8px 10px;
        text-align: left;
        border: none;
        position: relative;
        padding-left: 50%;
    }
    
    .data-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        font-weight: 600;
        color: #666;
    }
    
    .data-table td:last-child {
        padding-left: 10px;
        text-align: center;
    }
    
    .data-table td:last-child::before {
        display: none;
    }
}

/* =============== LANDSCAPE MOBILE =============== */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        padding-top: 60px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stat-card {
        flex-direction: column;
        padding: 12px 10px;
    }
    
    .stat-icon {
        font-size: 24px;
        margin: 0 0 8px 0;
    }
    
    .stat-info h3 {
        font-size: 20px;
    }
    
    .stat-info p {
        font-size: 11px;
    }
    
    .tracking-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* =============== TOUCH DEVICE OPTIMIZATIONS =============== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
    }
    
    .nav-item {
        min-height: 48px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        min-height: 44px;
    }
    
    /* Remove hover effects that don't work well on touch */
    .btn:hover {
        transform: none;
    }
    
    .message-item:hover {
        box-shadow: none;
    }
    
    .stat-card:hover {
        transform: none;
    }
    
    .nav-item:hover {
        transform: none;
    }
    
    /* Add active states instead */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .nav-item:active {
        background: rgba(255,255,255,0.2);
    }
    
    .message-item:active {
        background: #f0f0f0;
    }
}

/* =============== PRINT STYLES =============== */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .sidebar-overlay,
    .btn,
    .chat-reply-form,
    .tracking-update-section {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        background: white;
    }
}

/* =============== HIGH CONTRAST MODE =============== */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .badge {
        border: 1px solid currentColor;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        border-width: 2px;
    }
}

/* =============== REDUCED MOTION =============== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .sidebar {
        transition: none;
    }
}

/* =============== STORAGE WIDGET =============== */
.storage-widget {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-top: 5px;
}

.storage-bar {
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.storage-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.storage-fill.storage-success {
    background: linear-gradient(90deg, #28a745, #34d058);
}

.storage-fill.storage-warning {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.storage-fill.storage-danger {
    background: linear-gradient(90deg, #dc3545, #e83e8c);
}

.storage-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #495057;
}

.storage-used {
    font-weight: 600;
    color: #1a1a2e;
}

.storage-sep {
    color: #adb5bd;
}

.storage-total {
    color: #6c757d;
}

.storage-percent {
    color: #6c757d;
    font-size: 13px;
}

.storage-warning {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff3cd;
    color: #856404;
    border-radius: 6px;
    font-size: 13px;
}

/* Admin storage input */
.storage-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.storage-input-group input {
    width: 100px;
    text-align: center;
}

.storage-input-group select {
    width: 80px;
}

.storage-presets {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.storage-preset-btn {
    padding: 4px 10px;
    font-size: 12px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.storage-preset-btn:hover {
    background: #0f3460;
    color: white;
    border-color: #0f3460;
}

/* User list storage column */
.storage-mini {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.storage-mini-bar {
    height: 6px;
    width: 80px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.storage-mini-fill {
    height: 100%;
    border-radius: 3px;
}

.storage-mini-text {
    font-size: 11px;
    color: #6c757d;
}

@media (max-width: 768px) {
    .storage-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .storage-input-group input,
    .storage-input-group select {
        width: 100%;
    }
    
    .storage-mini-bar {
        width: 60px;
    }
}

/* =============== MEDIA FILES SECTION =============== */
.media-user-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.media-user-item {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.media-user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.2s;
}

.media-user-header:hover,
.media-user-header.active {
    background: #e9ecef;
}

.media-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.media-user-avatar,
.media-user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.media-user-avatar-placeholder {
    background: linear-gradient(135deg, #e94560 0%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.media-user-name {
    font-weight: 600;
    color: #1a1a2e;
}

.media-file-count {
    background: #0f3460;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.media-toggle-icon {
    color: #6c757d;
    font-size: 12px;
    transition: transform 0.3s;
}

.media-user-content {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.media-item {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    transition: transform 0.2s, box-shadow 0.2s;
}

.media-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.media-preview {
    width: 100%;
    height: 150px;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.media-preview img,
.media-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-type-icon {
    font-size: 48px;
}

.media-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.media-name {
    font-weight: 500;
    color: #1a1a2e;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-size {
    font-size: 12px;
    color: #6c757d;
}

.media-date {
    font-size: 11px;
    color: #adb5bd;
}

.media-actions {
    display: flex;
    gap: 8px;
    padding: 0 12px 12px;
}

.media-actions .btn {
    flex: 1;
    text-align: center;
}

/* =============== TRASH SECTION =============== */
.trash-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.trash-item {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.trash-item:hover {
    border-color: #fc8181;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.1);
}

.trash-preview {
    width: 100%;
    height: 120px;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.trash-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.trash-type-icon {
    font-size: 40px;
    opacity: 0.7;
}

.trash-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trash-name {
    font-weight: 500;
    color: #1a1a2e;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trash-user {
    font-size: 12px;
    color: #e94560;
    font-weight: 500;
}

.trash-size {
    font-size: 12px;
    color: #6c757d;
}

.trash-date {
    font-size: 11px;
    color: #adb5bd;
}

.trash-actions {
    display: flex;
    gap: 8px;
    padding: 0 12px 12px;
}

.trash-actions .btn {
    flex: 1;
    text-align: center;
}

/* Responsive Media & Trash */
@media (max-width: 768px) {
    .media-gallery,
    .trash-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .media-preview,
    .trash-preview {
        height: 100px;
    }
    
    .media-user-header {
        padding: 12px 15px;
    }
    
    .media-user-info {
        gap: 8px;
    }
    
    .media-user-avatar,
    .media-user-avatar-placeholder {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .media-user-name {
        font-size: 14px;
    }
    
    .media-file-count {
        font-size: 11px;
        padding: 2px 8px;
    }
}

@media (max-width: 480px) {
    .media-gallery,
    .trash-gallery {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .media-preview,
    .trash-preview {
        height: 80px;
    }
    
    .media-type-icon,
    .trash-type-icon {
        font-size: 30px;
    }
    
    .media-info,
    .trash-info {
        padding: 8px;
    }
    
    .media-actions,
    .trash-actions {
        padding: 0 8px 8px;
        gap: 5px;
    }
    
    .media-actions .btn,
    .trash-actions .btn {
        font-size: 12px;
        padding: 5px;
    }
}
