/* ===== MODAL STYLES ===== */
.crud-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.crud-modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  max-width: 540px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.crud-modal.open .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}

.modal-footer button {
  padding: 0.6rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-cancel:hover {
  background: var(--surface);
}

.btn-save {
  background: var(--accent);
  border: none;
  color: #fff;
}

.btn-save:hover:not(:disabled) {
  background: #00d4cd;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 195, 189, 0.4);
}

.btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-danger {
  background: #dc3545 !important;
}

.btn-danger:hover {
  background: #c82333 !important;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4) !important;
}

/* ===== FORM STYLES ===== */
.crud-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.crud-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.crud-form input,
.crud-form select,
.crud-form textarea {
  padding: 0.7rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.crud-form input:focus,
.crud-form select:focus,
.crud-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 195, 189, 0.1);
}

.crud-form input:invalid,
.crud-form select:invalid,
.crud-form textarea:invalid {
  border-color: #dc3545;
}

.crud-form input:invalid:focus,
.crud-form select:invalid:focus,
.crud-form textarea:invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.crud-form textarea {
  resize: vertical;
  min-height: 80px;
}

.text-muted {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ===== NOTIFICATION STYLES ===== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 1000001;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  min-width: 280px;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  border-left: 4px solid #28a745;
}

.notification.error {
  border-left: 4px solid #dc3545;
}

.notification.info {
  border-left: 4px solid #17a2b8;
}

.notification.warning {
  border-left: 4px solid #ffc107;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }

  .notification {
    right: 10px;
    left: 10px;
    min-width: auto;
  }
}
