/* Responsive */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    min-height: auto;
  }

  .admin-content {
    padding: 30px 20px;
  }

  .admin-cards, .admin-grid {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    flex-direction: column;
  }

  .admin-button {
    width: 100%;
    text-align: center;
  }

  .table-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .table-controls {
    flex-direction: column;
    gap: 10px;
  }

  .search-input, .filter-select {
    width: 100%;
  }

  .admin-table {
    font-size: 0.8em;
  }

  .admin-table th, .admin-table td {
    padding: 8px 6px;
  }

  .user-actions {
    flex-direction: column;
    gap: 3px;
  }

  .action-btn {
    font-size: 0.7em;
    padding: 3px 6px;
  }

  .pagination {
    flex-direction: column;
    gap: 15px;
  }

  .pagination-controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Modal responsive styles */
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .modal-header, .modal-body, .modal-footer {
    padding: 20px;
  }

  /* Messaging Modal Styles */
  .send-message-modal, .broadcast-modal {
    max-width: 600px;
  }

  .send-message-modal .form-group,
  .broadcast-modal .form-group {
    margin-bottom: 20px;
  }

  .send-message-modal label,
  .broadcast-modal label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2f2d2d;
    font-family: 'Crimson Text', 'Georgia', serif;
  }

  .send-message-modal input,
  .send-message-modal select,
  .send-message-modal textarea,
  .broadcast-modal input,
  .broadcast-modal select,
  .broadcast-modal textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Crimson Text', 'Georgia', serif;
    box-sizing: border-box;
  }

  .send-message-modal textarea,
  .broadcast-modal textarea {
    resize: vertical;
    min-height: 120px;
  }

  .warning-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 12px;
    margin-top: 15px;
  }

  .warning-note p {
    margin: 0;
    color: #856404;
    font-size: 14px;
  }

  .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
  }

  .cancel-btn, .send-message-btn, .broadcast-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
  }

  .cancel-btn {
    background: #6c757d;
    color: white;
  }

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

  .send-message-btn, .broadcast-btn {
    background: #007bff;
    color: white;
  }

  .send-message-btn:hover, .broadcast-btn:hover {
    background: #0056b3;
  }

  /* Broadcast to Users Modal Styles */
  .broadcast-users-modal {
    max-width: 700px;
  }

  .user-selection-container {
    margin-top: 10px;
  }

  .selection-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
    flex-wrap: wrap;
  }

  .select-all-btn, .deselect-all-btn {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Crimson Text', 'Georgia', serif;
    transition: all 0.2s ease;
  }

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

  .deselect-all-btn {
    background: #6c757d;
  }

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

  .search-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Crimson Text', 'Georgia', serif;
  }

  .selected-count {
    font-size: 14px;
    color: #495057;
    font-weight: 600;
    font-family: 'Crimson Text', 'Georgia', serif;
    white-space: nowrap;
  }

  .user-list {
    height: 300px;
    min-height: 300px;
    overflow-y: scroll;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0;
  }

  .user-checkbox-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s ease;
    margin: 0;
  }

  .user-checkbox-item:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
  }

  .user-checkbox-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
  }

  .user-checkbox-item:hover {
    background: #f8f9fa;
  }

  .user-checkbox {
    margin: 0;
    margin-right: 10px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    order: -1;
  }

  .user-email-label {
    font-size: 14px;
    color: #2f2d2d;
    font-family: 'Crimson Text', 'Georgia', serif;
    word-break: break-word;
    line-height: 1.4;
  }

  .broadcast-users-btn {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease;
  }

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

  /* Content Management Grid - Fixed 2 columns and width */
  .admin-content[data-section="content"] .admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: none;
    width: 100%;
    margin: 0 auto;
  }

  .admin-content[data-section="content"] .admin-card {
    min-height: 120px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Ensure content section maintains width */
  .admin-content[data-section="content"] .section-body {
    width: 100%;
    max-width: none;
  }

  /* Messages Table Styles */
  .messages-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
  }

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

  .messages-header h3 {
    margin: 0;
    color: #2f2d2d;
    font-family: 'Crimson Text', 'Georgia', serif;
    font-size: 1.3em;
    font-weight: 600;
  }

  .messages-filters {
    display: flex;
    gap: 15px;
    align-items: center;
  }

  .filter-select, .search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Crimson Text', 'Georgia', serif;
  }

  .search-input {
    min-width: 250px;
  }

  .messages-table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }

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

  .messages-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-family: 'Crimson Text', 'Georgia', serif;
  }

  .messages-table td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
  }

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

  .status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

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

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

  .view-message-btn, .resolve-btn {
    padding: 6px 12px;
    border: 1px solid #007bff;
    background: white;
    color: #007bff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 8px;
    transition: all 0.2s ease;
  }

  .view-message-btn:hover {
    background: #007bff;
    color: white;
  }

  .resolve-btn {
    border-color: #28a745;
    color: #28a745;
  }

  .resolve-btn:hover {
    background: #28a745;
    color: white;
  }

  .messages-pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
  }

  .no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px;
  }

  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .info-row label {
    min-width: auto;
  }

  .info-row span {
    text-align: left;
  }

  .modal-footer {
    flex-direction: column;
  }

  /* Tab responsive styles */
  .tab-buttons {
    padding: 15px 20px;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .tab-button {
    padding: 10px 15px;
    font-size: 0.9em;
    white-space: nowrap;
    flex: 1;
    min-width: 80px;
    text-align: center;
  }

  .tab-content {
    padding: 20px;
  }

  .subscription-actions, .project-actions {
    gap: 8px;
  }
}
