/* ============================= */
/*    DASHBOARD & ADMIN STYLES    */
/* ============================= */

/* ============================================
   NOTIFICATIONS STYLES
   ============================================ */
.notifications-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.notification-card {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  background: var(--card-bg, #fff);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.notification-card.unread {
  background: #f0f7ff;
  border-left: 4px solid #3498db;
}

.notification-card.read {
  opacity: 0.7;
}

.notification-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.notif-icon {
  font-size: 24px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-content {
  flex: 1;
}

.notif-content h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
  color: var(--text-color, #333);
}

.notif-content p {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--text-muted, #666);
}

.notif-date {
  font-size: 12px;
  color: #999;
}

.btn-mark-read {
  background: #27ae60;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.btn-mark-read:hover {
  background: #219a52;
}

.empty-message {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 16px;
}

/* Slot Items - Available time slots */
.slots-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slot-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(108, 99, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slot-item:hover {
    background: rgba(108, 99, 255, 0.15);
    border-color: var(--accent);
    transform: translateX(5px);
}

.slot-item.past {
    opacity: 0.5;
    cursor: not-allowed;
}

.slot-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 8px;
    background: var(--accent);
    border-radius: 8px;
    color: white;
}

.slot-date .day {
    font-size: 1.4rem;
    font-weight: bold;
    line-height: 1;
}

.slot-date .month {
    font-size: 0.75rem;
    text-transform: uppercase;
}

.slot-info {
    flex: 1;
}

.slot-day {
    font-weight: 600;
    color: var(--accent-2);
    text-transform: capitalize;
}

.slot-time {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.slot-action {
    flex-shrink: 0;
}

/* Booking Items - Client bookings list */
.booking-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(108, 99, 255, 0.2);
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.booking-item:hover {
    background: rgba(108, 99, 255, 0.1);
}

.booking-item.past {
    opacity: 0.6;
    border-color: rgba(108, 99, 255, 0.1);
}

.booking-item .booking-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 8px;
    background: var(--accent);
    border-radius: 8px;
    color: white;
}

.booking-item .booking-date .day {
    font-size: 1.4rem;
    font-weight: bold;
    line-height: 1;
}

.booking-item .booking-date .month {
    font-size: 0.75rem;
    text-transform: uppercase;
}

.booking-item .booking-info {
    flex: 1;
}

.booking-item .booking-title {
    font-weight: 600;
    color: var(--accent-2);
    margin-bottom: 5px;
}

.booking-item .booking-time,
.booking-item .booking-client {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.booking-item .booking-meet {
    margin-top: 5px;
}

.booking-item .booking-meet a {
    color: #4fc3f7;
    text-decoration: none;
    font-size: 0.9rem;
}

.booking-item .booking-meet a:hover {
    text-decoration: underline;
}

.booking-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 5px;
}

.booking-status.upcoming {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

.booking-status.past {
    background: rgba(149, 165, 166, 0.2);
    color: #95a5a6;
}

/* Improved booking item styling */
.booking-item {
    position: relative;
    overflow: hidden;
}

.booking-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
    border-radius: 4px 0 0 4px;
}

.booking-item.past::before {
    background: #95a5a6;
}

.booking-item .booking-date {
    background: linear-gradient(135deg, var(--accent), #6c5ce7);
}

/* Modal improvements */
#bookingModal .modal-content {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(108, 99, 255, 0.4);
}

#bookingModal .modal-header {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), transparent);
    border-radius: 16px 16px 0 0;
    margin: -25px -25px 20px -25px;
    padding: 20px 25px;
}

#bookingModal .modal-header h3 {
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--accent-2), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Slot filter improvements */
.slots-filter {
    background: rgba(108, 99, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(108, 99, 255, 0.1);
}

.slots-filter label {
    color: var(--accent-2);
    font-weight: 500;
    margin-bottom: 10px;
    display: block;
}

.slots-filter input[type="date"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(108, 99, 255, 0.2);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
}

.slots-filter input[type="date"]:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.2);
}

/* Slot item improvements */
.slot-item {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.08), rgba(108, 99, 255, 0.02));
    border: 1px solid rgba(108, 99, 255, 0.15);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slot-item:hover {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.15), rgba(108, 99, 255, 0.05));
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.slot-item .slot-date {
    background: linear-gradient(135deg, var(--accent), #6c5ce7);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-weight: 600;
}

.slot-item .slot-time {
    color: var(--accent-2);
    font-weight: 500;
}

/* Danger button */
.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.booking-status.upcoming {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

.booking-status.past {
    background: rgba(149, 165, 166, 0.2);
    color: #95a5a6;
}

/* Slots Filter */
.slots-filter {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.slots-filter label {
    font-weight: 600;
    color: var(--accent-2);
    margin-bottom: 8px;
    display: block;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #1a1a2e;
    border-radius: 16px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(108, 99, 255, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(108, 99, 255, 0.2);
}

.modal-header h3 {
    color: var(--accent-2);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: white;
}

.modal-body {
    color: rgba(255, 255, 255, 0.9);
}

/* Admin Message */
.admin-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
}

/* Small button */
.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Button icon */
.btn-icon {
    background: rgba(108, 99, 255, 0.2);
    border: none;
    color: var(--accent-2);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--accent);
    color: white;
}

/* Card actions */
.card-actions {
    display: flex;
    gap: 8px;
}

/* Empty state in cards */
.content-card .empty-state {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.content-card .empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
    opacity: 0.5;
}

.content-card .empty-state p {
    margin: 0;
}

/* Navigazione Tab (Client & Admin) */
.dashboard-nav, .admin-nav {
    display: flex;
    gap: 10px;
    background: rgba(15, 12, 41, 0.5);
    padding: 8px;
    border-radius: 12px;
    margin-bottom: 30px;
    overflow-x: auto;
    border: 1px solid rgba(108, 99, 255, 0.2);
}

.tab-btn, .admin-tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 15px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tab-btn::before, .admin-tab-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--accent-2);
    transition: width 0.3s ease;
}

.tab-btn:hover::before, .admin-tab-btn:hover::before {
    width: 80%;
}

.tab-btn.active, .admin-tab-btn.active {
    background: rgba(108, 99, 255, 0.2);
    color: var(--accent-2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.tab-btn.active::before, .admin-tab-btn.active::before {
    width: 80%;
}

.tab-btn:hover, .admin-tab-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Griglia Card Dashboard */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: transparent;
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid var(--accent);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.2) 0%, transparent 70%);
    transition: all 0.4s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.dashboard-card:hover::before {
    transform: scale(1.5);
}

.dashboard-card h4 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
}

.dashboard-card p {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    position: relative;
}

.dashboard-card .card-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: var(--accent);
    opacity: 0.2;
    transition: all 0.3s ease;
}

.dashboard-card:hover .card-icon {
    opacity: 0.5;
    transform: scale(1.2);
}

/* Modulo Booking & Form */
.booking-form {
    background: transparent;
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    transition: all 0.3s ease;
    border: 1px solid rgba(108, 99, 255, 0.2);
}

.booking-form:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Area Admin: Lista Clienti */
#clientsList {
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(108, 99, 255, 0.2);
}

/* Table styles */
#clientsList table {
    width: 100%;
    border-collapse: collapse;
}

#clientsList th,
#clientsList td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#clientsList th {
    background: rgba(108, 99, 255, 0.2);
    font-weight: 600;
    color: #fff;
}

#clientsList tr {
    transition: all 0.3s ease;
}

#clientsList tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.01);
}

/* Elementi Documenti (Grid) */
.docs-grid,
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.doc-item {
    background: transparent;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(108, 99, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.doc-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
}

.doc-item i {
    font-size: 2rem;
    color: var(--accent-2);
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.doc-item:hover i {
    transform: scale(1.2);
    color: var(--accent);
}

/* Document Card Styles for Client Documents */
.document-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(108, 99, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    border-color: var(--accent);
    background: rgba(108, 99, 255, 0.08);
}

.document-card .doc-icon {
    font-size: 2.5rem;
    color: var(--accent-2);
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.document-card:hover .doc-icon {
    transform: scale(1.15);
    color: var(--accent);
}

.document-card .doc-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #e0e0e0;
    margin-bottom: 8px;
    word-break: break-word;
    line-height: 1.4;
}

.document-card .doc-meta {
    font-size: 0.75rem;
    color: #888;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.document-card .doc-category {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(108, 99, 255, 0.15);
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--accent-2);
    margin-top: 8px;
}

/* Empty state for documents */
.documents-grid .empty-state,
.docs-grid .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.documents-grid .empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: rgba(108, 99, 255, 0.3);
}

/* Document count badge */
.doc-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(108, 99, 255, 0.15);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent-2);
}

/* Admin docs table improvements */
#adminDocsTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#adminDocsTable th {
    background: rgba(108, 99, 255, 0.1);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 2px solid rgba(108, 99, 255, 0.3);
}

#adminDocsTable td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

#adminDocsTable tbody tr:hover {
    background: rgba(108, 99, 255, 0.15);
}

#adminDocsTable .btn-delete {
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

#adminDocsTable .btn-delete:hover {
    background: rgba(231, 76, 60, 0.4);
    transform: scale(1.05);
}

/* Upload form grid - desktop */
.upload-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.upload-form-grid .form-group {
    width: 100%;
}

.upload-form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

/* Upload form wrapper */
.upload-form {
    margin-top: 20px;
}

/* Admin documents table base */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

/* Google Calendar Status Box */
#googleCalStatus {
    border: 1px solid rgba(66, 133, 244, 0.3);
    border-left: 5px solid #4285f4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-radius: 8px;
    background: transparent;
    transition: all 0.3s ease;
    color: #fff;
}

#googleCalStatus:hover {
    box-shadow: 0 5px 20px rgba(66, 133, 244, 0.2);
}

#googleCalStatus.connected {
    border-left-color: #27ae60;
    background: transparent;
}

/* Modalità caricamento (Skeleton effect) */
#clientLoading p {
    animation: pulse 1.5s infinite;
    color: var(--muted);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Container filtri admin */
#admin-clients > div:first-of-type {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* Input di ricerca */
#clientSearch {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px !important;
    border: 1px solid rgba(108, 99, 255, 0.3);
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
}

#clientSearch:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(255, 221, 87, 0.2);
}

/* Bottone Nuovo Cliente */
#openNewClient {
    padding: 10px 20px;
    background-color: var(--accent);
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#openNewClient::before {
    content: '+';
    margin-right: 5px;
    transition: transform 0.3s ease;
    display: inline-block;
}

#openNewClient:hover {
    background-color: var(--accent-2);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.3);
}

#openNewClient:hover::before {
    transform: rotate(90deg);
}

/* Pagination styles */
.pagination {
    display: flex;
    gap: 5px;
    margin-top: 20px;
    justify-content: center;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid rgba(108, 99, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-family: 'SEGO', 'Segoe UI', system-ui, sans-serif;
}

.pagination button:hover,
.pagination button.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.status-badge.pending {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.status-badge.inactive {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Action buttons in tables */
.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 5px;
}

.action-btn.edit {
    background: rgba(25, 118, 210, 0.2);
    color: #64b5f6;
}

.action-btn.delete {
    background: rgba(198, 40, 40, 0.2);
    color: #ef9a9a;
}

.action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-nav, .admin-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px;
    }
    
    .tab-btn, .admin-tab-btn {
        min-width: 100px;
        padding: 10px 12px;
        flex-shrink: 0;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .dashboard-card:hover {
        transform: none;
    }
    
    /* Fix text overflow in admin area */
    .card-body, .table-responsive, .content-card, .admin-tab-content {
        overflow: visible;
    }
    
    .card-body p, .card-body span, .card-body div {
        max-width: 100%;
        overflow: visible;
        white-space: normal;
        word-break: break-word;
    }
    
    /* Fix icon centering in admin buttons */
    .admin-tab-btn i, .tab-btn i, .btn i {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Project cards mobile */
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .project-card-admin {
        margin-bottom: 15px;
    }
    
    /* Upload form grid - stack on mobile */
    .upload-form-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .upload-form-grid .form-group {
        width: 100%;
    }
    
    .upload-form-grid .form-group.full-width {
        width: 100%;
    }
    
    /* Admin documents table - horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #adminDocsTable {
        min-width: 600px;
    }
    
    #adminDocsTable th,
    #adminDocsTable td {
        padding: 10px 8px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    /* Admin Documents tab - stack cards */
    .admin-tab-content .content-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    /* Upload area - better touch target */
    .upload-area {
        padding: 1.5rem;
        min-height: 120px;
    }
    
    .upload-area .upload-icon {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    /* Form inputs - full width on mobile */
    .upload-form .form-group input,
    .upload-form .form-group select,
    .upload-form .form-group textarea {
        width: 100%;
        font-size: 16px;
    }
    
    /* Action buttons - larger touch targets */
    .btn-delete,
    .action-btn {
        padding: 8px 12px;
        min-width: 36px;
        min-height: 36px;
    }
    
    /* Card header actions */
    .card-header {
        flex-wrap: wrap;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .upload-area {
        padding: 1rem;
    }
    
    .upload-area p {
        font-size: 0.9rem;
    }
    
    .upload-area .upload-hint {
        font-size: 0.75rem;
    }
    
    #adminDocsTable th,
    #adminDocsTable td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    
    .btn.btn-primary {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .tab-btn, .admin-tab-btn,
    .dashboard-card,
    .doc-item,
    #openNewClient,
    .pagination button,
    .action-btn {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}

/* ============================= */
/*    PROJECT MANAGEMENT STYLES  */
/* ============================= */

/* Project Form */
.project-form .form-group {
    margin-bottom: 1.2rem;
}

.project-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #fff;
    font-size: 0.9rem;
}

/* ============================= */
/*    TIMELINE STYLES             */
/* ============================= */

/* Timeline container */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
}

/* Timeline item */
.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.timeline-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Timeline dot */
.timeline-dot {
    width: 12px;
    height: 12px;
    min-width: 12px;
    border-radius: 50%;
    background: #6c63ff;
    margin-top: 4px;
}

/* Timeline content */
.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-title {
    font-weight: 600;
    color: #fff;
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-date {
    color: #aaa;
    font-size: 0.85rem;
    margin: 0;
}

.timeline-link {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 10px;
    background: rgba(108, 99, 255, 0.2);
    border-radius: 4px;
    color: #a5a0ff;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.timeline-link:hover {
    background: rgba(108, 99, 255, 0.4);
    color: #fff;
}

/* Timeline card specific */
.timeline-card .card-body {
    max-height: 400px;
    overflow-y: auto;
}

/* Empty state in timeline */
.timeline .empty-state {
    text-align: center;
    padding: 20px;
    color: #888;
}

.project-form input[type="text"],
.project-form input[type="number"],
.project-form select,
.project-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid rgba(108, 99, 255, 0.3);
    border-radius: 8px;
    font-size: 0.95rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    transition: border-color 0.3s ease;
}

.project-form input:focus,
.project-form select:focus,
.project-form textarea:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(255, 221, 87, 0.2);
}

/* Multi-select styling */
.project-form select[multiple] {
    height: auto;
    min-height: 160px;
    color: #333;
    background: white;
}

.project-form select[multiple] option {
    padding: 8px;
}

.project-form select[multiple] option:checked {
    background: var(--accent, #6c63ff);
    color: white;
}

.form-hint {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-top: 0.5rem;
}

/* Project Upload Area */
.project-upload-area {
    border: 2px dashed rgba(108, 99, 255, 0.4);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.project-upload-area:hover,
.project-upload-area.dragover {
    border-color: var(--accent, #6c63ff);
    background: rgba(108, 99, 255, 0.05);
}

.project-upload-area .upload-icon {
    font-size: 2.5rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.project-upload-area p {
    margin: 0;
    color: #666;
}

.project-upload-area .upload-link {
    color: var(--accent, #6c63ff);
    cursor: pointer;
}

.project-upload-area .upload-hint {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.5rem;
}

/* Image Preview */
.image-preview {
    position: relative;
    display: inline-block;
    margin-top: 1rem;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
}

.image-preview .remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.image-preview .remove-image:hover {
    transform: scale(1.1);
}

/* Projects Grid (Admin) */
.projects-grid {
    width: 100%;
}

.projects-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.project-card-admin {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card-admin:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.project-card-image {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.project-card-content {
    overflow: visible;
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card-admin:hover .project-card-image img {
    transform: scale(1.05);
}

.project-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card-admin:hover .project-card-overlay {
    opacity: 1;
}

.project-card-overlay .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.project-card-overlay .btn-icon:hover {
    transform: scale(1.1);
}

/* Project Admin Card - Modern Style with Overlay */
.projects-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.project-card-admin {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card-admin:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.project-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card-admin:hover .project-card-image img {
    transform: scale(1.1);
}

/* Dark gradient overlay on hover */
.project-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,0.8) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card-admin:hover .project-card-overlay {
    opacity: 1;
}

.project-card-overlay .btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: none;
    background: rgba(255,255,255,0.95);
    color: #1a1a2e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 18px;
}

.project-card-overlay .btn-icon:hover {
    transform: scale(1.15);
    background: white;
}

.project-card-overlay .btn-icon.btn-danger {
    background: rgba(255,255,255,0.95);
    color: #e74c3c;
}

.project-card-overlay .btn-icon.btn-danger:hover {
    background: #e74c3c;
    color: white;
}

/* Card Content */
.project-card-content {
    padding: 20px;
    background: white;
}

.project-card-content h4 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
}

.project-card-content .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-card-content .badge-success {
    background: #d4edda;
    color: #155724;
}

.project-card-content .badge-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Placeholder for no image */
.project-card-image .no-img {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: rgba(255,255,255,0.5);
}

.project-card-img {
    height: 160px;
    overflow: hidden;
    background: #f0f0f0;
}

.project-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card-img .no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 2rem;
}

.project-card-info {
    padding: 15px;
    flex: 1;
}

.project-card-info h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: #333;
}

.project-card-meta {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 10px;
}

.project-card-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.project-card-status.attivo {
    background: #d4edda;
    color: #155724;
}

.project-card-status.inattivo {
    background: #f8d7da;
    color: #721c24;
}

.project-card-actions {
    display: flex;
    gap: 8px;
    padding: 0 15px 15px;
}

.project-card-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.project-card-actions .btn-edit {
    background: #e7f3ff;
    color: #0066cc;
}

.project-card-actions .btn-edit:hover {
    background: #0066cc;
    color: white;
}

.project-card-actions .btn-delete {
    background: #ffe7e7;
    color: #cc0000;
}

.project-card-actions .btn-delete:hover {
    background: #cc0000;
    color: white;
}

/* Gallery Styles */
.gallery-preview {
    margin: 20px 0;
}

.gallery-preview label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .remove-gallery {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(255,0,0,0.8);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.gallery-upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.gallery-upload-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-upload-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-upload-item .remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(255,0,0,0.8);
    color: white;
    cursor: pointer;
}

.project-card-overlay .btn-icon.btn-danger:hover {
    background: #e74c3c;
    color: white;
}

.project-card-content {
    padding: 1rem;
}

.project-card-content h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #333;
}

.project-cliente {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 0.5rem;
}

.project-card-content .badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e8e8e8;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #666;
    margin-right: 5px;
}

.project-card-content .badge-success {
    background: #d4edda;
    color: #155724;
}

.project-card-content .badge-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Empty & Error States */
.empty-state, .error-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.empty-state i, .error-state i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.error-state i {
    color: #e74c3c;
}

/* Admin Message */
.admin-message {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

/* Rich Text Editor */
.rich-text-editor {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.rich-text-toolbar {
    background: #f5f5f5;
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.rich-text-toolbar button {
    background: none;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    color: #333;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.rich-text-toolbar button:hover {
    background: #e0e0e0;
}

.rich-text-toolbar .toolbar-separator {
    color: #ccc;
    margin: 0 4px;
}

.rich-text-content {
    min-height: 150px;
    padding: 15px;
    outline: none;
    font-size: 1rem;
    line-height: 1.6;
}

.rich-text-content:empty:before {
    content: attr(placeholder);
    color: #999;
}

.rich-text-content h2 {
    font-size: 1.5rem;
    margin: 0 0 10px 0;
}

.rich-text-content h3 {
    font-size: 1.2rem;
    margin: 0 0 10px 0;
}

.rich-text-content ul, .rich-text-content ol {
    margin: 10px 0;
    padding-left: 25px;
}

/* Document Management - New Styles */
.month-group {
    margin-bottom: 30px;
}

.month-title {
    font-size: 1.1rem;
    color: var(--accent-2);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(108, 99, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 8px;
    margin-right: 15px;
}

.view-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.view-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.document-card {
    position: relative;
    border: 1px solid rgba(108, 99, 255, 0.1);
}

.document-card.unread {
    border-left: 4px solid var(--accent);
}

.document-card.read {
    opacity: 0.85;
}

.doc-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
    opacity: 0.8;
}

.read-status {
    margin-left: auto;
    font-size: 0.8rem;
}

/* Document Calendar */
.document-calendar {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(108, 99, 255, 0.1);
}

.document-calendar .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.document-calendar .calendar-header h4 {
    margin: 0;
    text-transform: capitalize;
    color: var(--accent-2);
}

.document-calendar .calendar-header button {
    background: rgba(108, 99, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

.document-calendar .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.document-calendar .weekday {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    padding-bottom: 10px;
}

.document-calendar .day {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: default;
}

.document-calendar .day.empty {
    visibility: hidden;
}

.document-calendar .day.has-docs {
    background: rgba(108, 99, 255, 0.1);
    box-shadow: inset 0 0 0 1px rgba(108, 99, 255, 0.3);
}

.document-calendar .day-num {
    font-size: 0.9rem;
    font-weight: 600;
}

.document-calendar .day-docs {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
    margin-top: 4px;
}

.document-calendar .doc-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.document-calendar .doc-dot:hover {
    transform: scale(1.5);
    background: white;
}

/* Document Calendar - Note Layout */
.calendar-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}

@media screen and (min-width: 992px) {
  .calendar-layout {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.calendar-note-section {
  position: sticky;
  top: 20px;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.doc-dot.read {
  background: #4fc3f7 !important; /* WhatsApp blue */
  box-shadow: 0 0 5px rgba(79, 195, 247, 0.5);
}

.calendar-note-section .content-card {
  border: 1px solid rgba(108, 99, 255, 0.2);
}

.calendar-note-section .card-header {
  background: linear-gradient(135deg, #6c5ce7 0%, #5652d4 100%);
  color: white;
  padding: 10px 15px;
}

.calendar-note-section .card-header h3 {
  color: white !important;
  font-size: 1rem;
}

#noteDocInfo a {
  color: #6c5ce7;
  text-decoration: none;
  font-weight: 700;
}

#noteDocInfo a:hover {
  text-decoration: underline;
}

.btn-icon#closeNote {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#docNoteText {
  background: #fff;
  color: #333;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  border: 1px solid #ddd;
  transition: border-color 0.3s;
}

#docNoteText:focus {
  border-color: #6c5ce7;
  outline: none;
}
