/* =============================================
   Modal Component
   ============================================= */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeUp 0.3s ease;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

.modal::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

.modal-small {
  max-width: 400px;
}

/* Responsive styles for delete/confirmation modals */
@media (max-width: 480px) {
  .modal-small {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }

  .modal-small .modal-header {
    padding: 10px 10px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 15px !important;
  }

  .modal-small .modal-body {
    padding: 10px !important;
  }

  .modal-small .modal-body p {
    font-size: 12px !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 10px !important;
  }

  .modal-small .modal-body strong {
    font-size: 12px !important;
  }

  .modal-small .modal-actions {
    padding: 6px 10px 10px !important;
    gap: 6px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 8px 12px !important;
    font-size: 11px !important;
  }
}

.modal-medium {
  max-width: 700px;
}

.modal-large {
  max-width: 800px;
}

.modal-wide {
  max-width: 900px;
}

.modal-xl {
  max-width: 1100px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close svg {
  width: 20px;
  height: 20px;
  fill: var(--text-secondary);
}

.modal-close:hover {
  border-color: var(--error);
}

.modal-close:hover svg {
  fill: var(--error);
}

.modal form,
.modal-body {
  padding: 24px;
}

.modal-body p {
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-body .text-muted {
  color: var(--text-secondary);
  font-size: 14px;
}

.modal-body p {
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-body strong {
  font-weight: 600;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  gap: 12px;
  padding: 0 24px 24px;
}

.modal-actions .btn {
  flex: 1;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .modal-overlay {
    padding: 16px;
  }

  .modal-header {
    padding: 20px 20px 0;
  }

  .modal-header h3 {
    font-size: 18px;
  }

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

  .modal-actions {
    padding: 0 20px 20px;
  }
}

@media (max-width: 768px) {
  .modal-overlay {
    padding: 12px;
  }

  .modal {
    max-height: 95vh;
  }

  .modal-header {
    padding: 18px 18px 0;
  }

  .modal-header h3 {
    font-size: 17px;
  }

  .modal-close {
    width: 32px;
    height: 32px;
  }
}

/* Tablet portrait (768x1024) - specific optimizations */
@media (width: 768px) and (height: 1024px) and (orientation: portrait) {
  .modal-overlay {
    padding: 20px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .modal {
    max-height: 96vh !important;
    border-radius: 20px !important;
  }

  .modal-header {
    padding: 20px 20px 0 !important;
  }

  .modal-header h3 {
    font-size: 22px !important;
  }

  .modal-close {
    width: 36px !important;
    height: 36px !important;
  }

  .modal-close svg {
    width: 20px !important;
    height: 20px !important;
  }

  .modal form,
  .modal-body {
    padding: 20px !important;
  }
}

/* Tablet portrait (820x1180) - specific optimizations */
@media (width: 820px) and (height: 1180px) and (orientation: portrait) {
  .modal-overlay {
    padding: 24px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .modal {
    max-height: 97vh !important;
    border-radius: 22px !important;
  }

  .modal-header {
    padding: 22px 22px 0 !important;
  }

  .modal-header h3 {
    font-size: 24px !important;
  }

  .modal-close {
    width: 38px !important;
    height: 38px !important;
  }

  .modal-close svg {
    width: 22px !important;
    height: 22px !important;
  }

  .modal form,
  .modal-body {
    padding: 22px !important;
  }
}

/* Tablet portrait (912x1368) - specific optimizations */
@media (width: 912px) and (height: 1368px) and (orientation: portrait) {
  .modal-overlay {
    padding: 26px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .modal {
    max-height: 98vh !important;
    border-radius: 24px !important;
  }

  .modal-header {
    padding: 24px 24px 0 !important;
  }

  .modal-header h3 {
    font-size: 26px !important;
  }

  .modal-close {
    width: 40px !important;
    height: 40px !important;
  }

  .modal-close svg {
    width: 24px !important;
    height: 24px !important;
  }

  .modal form,
  .modal-body {
    padding: 24px !important;
  }
}

/* Tablet portrait (800x1145) - specific optimizations */
@media (width: 800px) and (height: 1145px) and (orientation: portrait),
(min-width: 798px) and (max-width: 802px) and (min-height: 1143px) and (max-height: 1147px) and (orientation: portrait) {
  .modal-overlay {
    padding: 12px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .modal {
    max-height: 92vh !important;
    border-radius: 16px !important;
  }

  .modal-header {
    padding: 14px 16px 0 !important;
  }

  .modal-header h3 {
    font-size: 18px !important;
  }

  .modal-close {
    width: 32px !important;
    height: 32px !important;
  }

  .modal-close svg {
    width: 18px !important;
    height: 18px !important;
  }

  .modal form,
  .modal-body {
    padding: 14px 16px !important;
  }
}

/* Tablet portrait (640x889) - specific optimizations */
@media (width: 640px) and (height: 889px) and (orientation: portrait),
(min-width: 638px) and (max-width: 642px) and (min-height: 887px) and (max-height: 891px) and (orientation: portrait) {
  .modal-overlay {
    padding: 10px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .modal {
    max-height: 90vh !important;
    border-radius: 14px !important;
  }

  .modal-header {
    padding: 12px 14px 0 !important;
  }

  .modal-header h3 {
    font-size: 16px !important;
  }

  .modal-close {
    width: 30px !important;
    height: 30px !important;
  }

  .modal-close svg {
    width: 16px !important;
    height: 16px !important;
  }

  .modal form,
  .modal-body {
    padding: 12px 14px !important;
  }
}

/* Tablet landscape (1024x505) - compact modal */
@media (width: 1024px) and (height: 505px) and (orientation: landscape),
(min-width: 1022px) and (max-width: 1026px) and (min-height: 503px) and (max-height: 507px) and (orientation: landscape) {
  .modal-overlay {
    padding: 8px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .modal {
    max-height: 88vh !important;
    border-radius: 12px !important;
  }

  .modal-header {
    padding: 10px 12px 0 !important;
  }

  .modal-header h3 {
    font-size: 15px !important;
  }

  .modal-close {
    width: 28px !important;
    height: 28px !important;
  }

  .modal-close svg {
    width: 14px !important;
    height: 14px !important;
  }

  .modal {
    width: min(1000px, 98vw) !important;
  }

  .modal form,
  .modal-body {
    padding: 10px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .modal.modal-large {
    max-width: min(900px, 98vw) !important;
    width: min(900px, 98vw) !important;
  }
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal form,
.modal-body {
  padding: 18px;
}

.modal-actions {
  padding: 0 18px 18px;
  gap: 10px;
}
}

@media (max-width: 480px) {
  .modal-overlay {
    padding: 4px !important;
  }

  .modal {
    margin: 0 !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    border-radius: 12px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .modal-header {
    padding: 8px 8px 0 !important;
  }

  .modal-header h3 {
    font-size: 14px !important;
  }

  .modal-close {
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
  }

  .modal-close svg {
    width: 16px !important;
    height: 16px !important;
  }

  .modal form,
  .modal-body {
    padding: 8px !important;
  }

  .modal-actions {
    padding: 6px 8px 8px !important;
    gap: 5px !important;
    margin-top: 6px !important;
  }

  .modal-actions .btn {
    width: 100% !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 8px 12px !important;
    font-size: 11px !important;
  }

  .modal-body {
    padding: 12px !important;
  }

  .modal-body p {
    font-size: 13px !important;
    margin-bottom: 8px !important;
    line-height: 1.4 !important;
  }

  .modal-body .text-muted {
    font-size: 11px !important;
  }

  .modal-body strong {
    font-size: 13px !important;
  }
}

/* Phone portrait (375x667) - specific optimizations */
@media (width: 375px) and (height: 667px) and (orientation: portrait) {
  .modal-overlay {
    padding: 1px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 1px;
    max-height: 99.5vh;
    border-radius: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 8px 8px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 12px;
  }

  .modal-close {
    width: 20px;
    height: 20px;
  }

  .modal-close svg {
    width: 11px;
    height: 11px;
  }

  .modal form,
  .modal-body {
    padding: 8px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 8px 8px;
    gap: 4px;
    flex-shrink: 0;
  }
}

/* Phone portrait (430x932) - specific optimizations */
@media (width: 430px) and (height: 932px) and (orientation: portrait) {
  .modal-overlay {
    padding: 2px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 2px;
    max-height: 99vh;
    border-radius: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 10px 10px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 14px;
  }

  .modal-close {
    width: 24px;
    height: 24px;
  }

  .modal-close svg {
    width: 13px;
    height: 13px;
  }

  .modal form,
  .modal-body {
    padding: 10px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 10px 10px;
    gap: 6px;
    flex-shrink: 0;
  }
}

/* Phone portrait (1080x2400) - specific optimizations */
@media (width: 1080px) and (height: 2400px) and (orientation: portrait) {
  .modal-overlay {
    padding: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 8px;
    max-height: 98vh;
    border-radius: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 20px 20px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 20px;
  }

  .modal-close {
    width: 36px;
    height: 36px;
  }

  .modal-close svg {
    width: 20px;
    height: 20px;
  }

  .modal form,
  .modal-body {
    padding: 20px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 20px 20px;
    gap: 10px;
    flex-shrink: 0;
  }
}

/* 1080p portrait (1080px width) - general optimizations */
@media (width: 1080px) and (orientation: portrait) {
  .modal-overlay {
    padding: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 8px;
    max-height: 98vh;
    border-radius: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 20px 20px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 20px;
  }

  .modal-close {
    width: 36px;
    height: 36px;
  }

  .modal-close svg {
    width: 20px;
    height: 20px;
  }

  .modal form,
  .modal-body {
    padding: 20px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 20px 20px;
    gap: 10px;
    flex-shrink: 0;
  }
}

/* Phone portrait (411x823) - specific optimizations */
@media (width: 411px) and (height: 823px) and (orientation: portrait) {
  .modal-overlay {
    padding: 2px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 2px;
    max-height: 99vh;
    border-radius: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 10px 10px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 14px;
  }

  .modal-close {
    width: 24px;
    height: 24px;
  }

  .modal-close svg {
    width: 13px;
    height: 13px;
  }

  .modal form,
  .modal-body {
    padding: 10px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 10px 10px;
    gap: 6px;
    flex-shrink: 0;
  }
}

/* 1080x2400 portrait 380dpi - high DPI optimizations */
@media (width: 1080px) and (height: 2400px) and (orientation: portrait) and (resolution: 380dpi),
(width: 1080px) and (height: 2400px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2.375) {
  .modal-overlay {
    padding: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 8px;
    max-height: 98vh;
    border-radius: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 20px 20px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 20px;
  }

  .modal-close {
    width: 36px;
    height: 36px;
  }

  .modal-close svg {
    width: 20px;
    height: 20px;
  }

  .modal form,
  .modal-body {
    padding: 20px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 20px 20px;
    gap: 10px;
    flex-shrink: 0;
  }
}

/* Phone portrait (412x892) - specific optimizations */
@media (width: 412px) and (height: 892px) and (orientation: portrait) {
  .modal-overlay {
    padding: 2px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 2px;
    max-height: 99vh;
    border-radius: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 10px 10px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 14px;
  }

  .modal-close {
    width: 24px;
    height: 24px;
  }

  .modal-close svg {
    width: 13px;
    height: 13px;
  }

  .modal form,
  .modal-body {
    padding: 10px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 10px 10px;
    gap: 6px;
    flex-shrink: 0;
  }
}

/* Phone portrait (412x915) - specific optimizations */
@media (width: 412px) and (height: 915px) and (orientation: portrait) {
  .modal-overlay {
    padding: 2px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 2px;
    max-height: 99vh;
    border-radius: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 10px 10px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 14px;
  }

  .modal-close {
    width: 24px;
    height: 24px;
  }

  .modal-close svg {
    width: 13px;
    height: 13px;
  }

  .modal form,
  .modal-body {
    padding: 10px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 10px 10px;
    gap: 6px;
    flex-shrink: 0;
  }
}

/* Phone portrait (414x736) - specific optimizations */
@media (width: 414px) and (height: 736px) and (orientation: portrait) {
  .modal-overlay {
    padding: 2px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 2px;
    max-height: 99vh;
    border-radius: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 10px 10px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 14px;
  }

  .modal-close {
    width: 24px;
    height: 24px;
  }

  .modal-close svg {
    width: 13px;
    height: 13px;
  }

  .modal form,
  .modal-body {
    padding: 10px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 10px 10px;
    gap: 6px;
    flex-shrink: 0;
  }
}

/* Phone portrait (414x896) - specific optimizations */
@media (width: 414px) and (height: 896px) and (orientation: portrait) {
  .modal-overlay {
    padding: 2px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 2px;
    max-height: 99vh;
    border-radius: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 10px 10px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 14px;
  }

  .modal-close {
    width: 24px;
    height: 24px;
  }

  .modal-close svg {
    width: 13px;
    height: 13px;
  }

  .modal form,
  .modal-body {
    padding: 10px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 10px 10px;
    gap: 6px;
    flex-shrink: 0;
  }
}

/* Delete modal responsive styles for specific portrait sizes */
/* Phone portrait (360x740) - delete modal */
@media (width: 360px) and (height: 740px) and (orientation: portrait) {
  .modal-small {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 10px !important;
  }

  .modal-small .modal-header {
    padding: 8px 8px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 14px !important;
  }

  .modal-small .modal-body {
    padding: 8px !important;
  }

  .modal-small .modal-body p {
    font-size: 11px !important;
    margin-bottom: 5px !important;
    line-height: 1.3 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 9px !important;
  }

  .modal-small .modal-body strong {
    font-size: 11px !important;
  }

  .modal-small .modal-actions {
    padding: 5px 8px 8px !important;
    gap: 5px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 7px 10px !important;
    font-size: 10px !important;
  }
}

/* Phone portrait (375x667) - delete modal */
@media (width: 375px) and (height: 667px) and (orientation: portrait) {
  .modal-small {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 10px !important;
  }

  .modal-small .modal-header {
    padding: 8px 8px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 14px !important;
  }

  .modal-small .modal-body {
    padding: 8px !important;
  }

  .modal-small .modal-body p {
    font-size: 11px !important;
    margin-bottom: 5px !important;
    line-height: 1.3 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 9px !important;
  }

  .modal-small .modal-body strong {
    font-size: 11px !important;
  }

  .modal-small .modal-actions {
    padding: 5px 8px 8px !important;
    gap: 5px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 7px 10px !important;
    font-size: 10px !important;
  }
}

/* Phone portrait (375x812) - delete modal */
@media (width: 375px) and (height: 812px) and (orientation: portrait) {
  .modal-small {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 11px !important;
  }

  .modal-small .modal-header {
    padding: 9px 9px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 15px !important;
  }

  .modal-small .modal-body {
    padding: 9px !important;
  }

  .modal-small .modal-body p {
    font-size: 12px !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 10px !important;
  }

  .modal-small .modal-body strong {
    font-size: 12px !important;
  }

  .modal-small .modal-actions {
    padding: 6px 9px 9px !important;
    gap: 6px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 8px 11px !important;
    font-size: 11px !important;
  }
}

/* Phone portrait (380x706) - delete modal */
@media (width: 380px) and (height: 706px) and (orientation: portrait) {
  .modal-small {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 10px !important;
  }

  .modal-small .modal-header {
    padding: 8px 8px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 14px !important;
  }

  .modal-small .modal-body {
    padding: 8px !important;
  }

  .modal-small .modal-body p {
    font-size: 11px !important;
    margin-bottom: 5px !important;
    line-height: 1.3 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 9px !important;
  }

  .modal-small .modal-body strong {
    font-size: 11px !important;
  }

  .modal-small .modal-actions {
    padding: 5px 8px 8px !important;
    gap: 5px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 7px 10px !important;
    font-size: 10px !important;
  }
}

/* Phone portrait (380x754) and (380x810) - delete modal */
@media (min-width: 375px) and (max-width: 385px) and (min-height: 750px) and (max-height: 820px) and (orientation: portrait),
(width: 380px) and (height: 754px) and (orientation: portrait),
(width: 380px) and (height: 810px) and (orientation: portrait) {
  .modal-small {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 11px !important;
  }

  .modal-small .modal-header {
    padding: 9px 9px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 15px !important;
  }

  .modal-small .modal-body {
    padding: 9px !important;
  }

  .modal-small .modal-body p {
    font-size: 12px !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 10px !important;
  }

  .modal-small .modal-body strong {
    font-size: 12px !important;
  }

  .modal-small .modal-actions {
    padding: 6px 9px 9px !important;
    gap: 6px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 8px 11px !important;
    font-size: 11px !important;
  }
}

/* Phone portrait (390x844) - delete modal */
@media (width: 390px) and (height: 844px) and (orientation: portrait) {
  .modal-small {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 11px !important;
  }

  .modal-small .modal-header {
    padding: 9px 9px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 15px !important;
  }

  .modal-small .modal-body {
    padding: 9px !important;
  }

  .modal-small .modal-body p {
    font-size: 12px !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 10px !important;
  }

  .modal-small .modal-body strong {
    font-size: 12px !important;
  }

  .modal-small .modal-actions {
    padding: 6px 9px 9px !important;
    gap: 6px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 8px 11px !important;
    font-size: 11px !important;
  }
}

/* Phone portrait (411x823) - delete modal */
@media (width: 411px) and (height: 823px) and (orientation: portrait) {
  .modal-small {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }

  .modal-small .modal-header {
    padding: 10px 10px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 15px !important;
  }

  .modal-small .modal-body {
    padding: 10px !important;
  }

  .modal-small .modal-body p {
    font-size: 12px !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 10px !important;
  }

  .modal-small .modal-body strong {
    font-size: 12px !important;
  }

  .modal-small .modal-actions {
    padding: 6px 10px 10px !important;
    gap: 6px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 8px 12px !important;
    font-size: 11px !important;
  }
}

/* Phone portrait (412x892) - delete modal */
@media (width: 412px) and (height: 892px) and (orientation: portrait) {
  .modal-small {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }

  .modal-small .modal-header {
    padding: 10px 10px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 15px !important;
  }

  .modal-small .modal-body {
    padding: 10px !important;
  }

  .modal-small .modal-body p {
    font-size: 12px !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 10px !important;
  }

  .modal-small .modal-body strong {
    font-size: 12px !important;
  }

  .modal-small .modal-actions {
    padding: 6px 10px 10px !important;
    gap: 6px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 8px 12px !important;
    font-size: 11px !important;
  }
}

/* Phone portrait (412x915) - delete modal */
@media (width: 412px) and (height: 915px) and (orientation: portrait) {
  .modal-small {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }

  .modal-small .modal-header {
    padding: 10px 10px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 15px !important;
  }

  .modal-small .modal-body {
    padding: 10px !important;
  }

  .modal-small .modal-body p {
    font-size: 12px !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 10px !important;
  }

  .modal-small .modal-body strong {
    font-size: 12px !important;
  }

  .modal-small .modal-actions {
    padding: 6px 10px 10px !important;
    gap: 6px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 8px 12px !important;
    font-size: 11px !important;
  }
}

/* Phone portrait (414x736) - delete modal */
@media (width: 414px) and (height: 736px) and (orientation: portrait) {
  .modal-small {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 11px !important;
  }

  .modal-small .modal-header {
    padding: 9px 9px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 14px !important;
  }

  .modal-small .modal-body {
    padding: 9px !important;
  }

  .modal-small .modal-body p {
    font-size: 11px !important;
    margin-bottom: 5px !important;
    line-height: 1.3 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 9px !important;
  }

  .modal-small .modal-body strong {
    font-size: 11px !important;
  }

  .modal-small .modal-actions {
    padding: 5px 9px 9px !important;
    gap: 5px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 7px 11px !important;
    font-size: 10px !important;
  }
}

/* Phone portrait (414x896) - delete modal */
@media (width: 414px) and (height: 896px) and (orientation: portrait) {
  .modal-small {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }

  .modal-small .modal-header {
    padding: 10px 10px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 15px !important;
  }

  .modal-small .modal-body {
    padding: 10px !important;
  }

  .modal-small .modal-body p {
    font-size: 12px !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 10px !important;
  }

  .modal-small .modal-body strong {
    font-size: 12px !important;
  }

  .modal-small .modal-actions {
    padding: 6px 10px 10px !important;
    gap: 6px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 8px 12px !important;
    font-size: 11px !important;
  }
}

/* Phone portrait (430x932) - delete modal */
@media (width: 430px) and (height: 932px) and (orientation: portrait) {
  .modal-small {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }

  .modal-small .modal-header {
    padding: 11px 11px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 16px !important;
  }

  .modal-small .modal-body {
    padding: 11px !important;
  }

  .modal-small .modal-body p {
    font-size: 13px !important;
    margin-bottom: 7px !important;
    line-height: 1.4 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 11px !important;
  }

  .modal-small .modal-body strong {
    font-size: 13px !important;
  }

  .modal-small .modal-actions {
    padding: 7px 11px 11px !important;
    gap: 7px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 9px 13px !important;
    font-size: 12px !important;
  }
}

/* 1080x2400 portrait - delete modal */
@media (width: 1080px) and (height: 2400px) and (orientation: portrait) {
  .modal-small {
    max-width: 500px !important;
    margin: auto !important;
    border-radius: 16px !important;
  }

  .modal-small .modal-header {
    padding: 20px 20px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 22px !important;
  }

  .modal-small .modal-body {
    padding: 20px !important;
  }

  .modal-small .modal-body p {
    font-size: 16px !important;
    margin-bottom: 10px !important;
    line-height: 1.5 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 14px !important;
  }

  .modal-small .modal-body strong {
    font-size: 16px !important;
  }

  .modal-small .modal-actions {
    padding: 10px 20px 20px !important;
    gap: 12px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 14px 20px !important;
    font-size: 15px !important;
  }
}

/* 1080p portrait (1080px width) - delete modal */
@media (width: 1080px) and (orientation: portrait) {
  .modal-small {
    max-width: 500px !important;
    margin: auto !important;
    border-radius: 16px !important;
  }

  .modal-small .modal-header {
    padding: 20px 20px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 22px !important;
  }

  .modal-small .modal-body {
    padding: 20px !important;
  }

  .modal-small .modal-body p {
    font-size: 16px !important;
    margin-bottom: 10px !important;
    line-height: 1.5 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 14px !important;
  }

  .modal-small .modal-body strong {
    font-size: 16px !important;
  }

  .modal-small .modal-actions {
    padding: 10px 20px 20px !important;
    gap: 12px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 14px 20px !important;
    font-size: 15px !important;
  }
}

/* Small phones landscape - delete modal */
@media (orientation: landscape) and (max-height: 430px) and (max-width: 900px) {
  .modal-small {
    max-width: 90% !important;
    margin: auto !important;
    border-radius: 10px !important;
  }

  .modal-small .modal-header {
    padding: 8px 10px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 14px !important;
  }

  .modal-small .modal-body {
    padding: 8px 10px !important;
  }

  .modal-small .modal-body p {
    font-size: 11px !important;
    margin-bottom: 4px !important;
    line-height: 1.3 !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 9px !important;
  }

  .modal-small .modal-body strong {
    font-size: 11px !important;
  }

  .modal-small .modal-actions {
    padding: 5px 10px 8px !important;
    gap: 5px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 6px 10px !important;
    font-size: 10px !important;
  }
}

@media (orientation: landscape) and (max-height: 320px) {
  .modal-small {
    max-width: 85% !important;
  }

  .modal-small .modal-header {
    padding: 6px 8px 0 !important;
  }

  .modal-small .modal-header h3 {
    font-size: 13px !important;
  }

  .modal-small .modal-body {
    padding: 6px 8px !important;
  }

  .modal-small .modal-body p {
    font-size: 10px !important;
    margin-bottom: 3px !important;
  }

  .modal-small .modal-body .text-muted {
    font-size: 8px !important;
  }

  .modal-small .modal-body strong {
    font-size: 10px !important;
  }

  .modal-small .modal-actions {
    padding: 4px 8px 6px !important;
    gap: 4px !important;
  }

  .modal-small .modal-actions .btn {
    padding: 5px 8px !important;
    font-size: 9px !important;
  }
}

/* Phone portrait (360x740) - specific optimizations */
@media (width: 360px) and (height: 740px) and (orientation: portrait) {
  .modal-overlay {
    padding: 1px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 1px;
    max-height: 99.5vh;
    border-radius: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 8px 8px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 12px;
  }

  .modal-close {
    width: 20px;
    height: 20px;
  }

  .modal-close svg {
    width: 11px;
    height: 11px;
  }

  .modal form,
  .modal-body {
    padding: 8px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 8px 8px;
    gap: 4px;
    flex-shrink: 0;
  }
}

/* Phone portrait (360x800) - specific optimizations */
@media (width: 360px) and (height: 800px) and (orientation: portrait),
(min-width: 358px) and (max-width: 362px) and (min-height: 798px) and (max-height: 802px) and (orientation: portrait) {
  .modal-overlay {
    padding: 1px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 1px;
    max-height: 99.5vh;
    border-radius: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 8px 8px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 12px;
  }

  .modal-close {
    width: 20px;
    height: 20px;
  }

  .modal-close svg {
    width: 11px;
    height: 11px;
  }

  .modal form,
  .modal-body {
    padding: 8px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 8px 8px;
    gap: 4px;
    flex-shrink: 0;
  }
}

/* Phone portrait (375x812) - specific optimizations */
@media (width: 375px) and (height: 812px) and (orientation: portrait) {
  .modal-overlay {
    padding: 1px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 1px;
    max-height: 99.5vh;
    border-radius: 9px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 9px 9px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 13px;
  }

  .modal-close {
    width: 22px;
    height: 22px;
  }

  .modal-close svg {
    width: 12px;
    height: 12px;
  }

  .modal form,
  .modal-body {
    padding: 9px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 9px 9px;
    gap: 5px;
    flex-shrink: 0;
  }
}

/* Phone portrait (380x706) - specific optimizations */
@media (width: 380px) and (height: 706px) and (orientation: portrait) {
  .modal-overlay {
    padding: 1px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 1px;
    max-height: 99.5vh;
    border-radius: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 8px 8px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 12px;
  }

  .modal-close {
    width: 20px;
    height: 20px;
  }

  .modal-close svg {
    width: 11px;
    height: 11px;
  }

  .modal form,
  .modal-body {
    padding: 8px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 8px 8px;
    gap: 4px;
    flex-shrink: 0;
  }
}

/* Phone portrait (380x754) - specific optimizations */
@media (width: 380px) and (height: 754px) and (orientation: portrait) {
  .modal-overlay {
    padding: 1px !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 1px !important;
    max-height: 99.5vh !important;
    border-radius: 9px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 9px 9px 0 !important;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 13px !important;
  }

  .modal-close {
    width: 22px !important;
    height: 22px !important;
  }

  .modal-close svg {
    width: 12px !important;
    height: 12px !important;
  }

  .modal form,
  .modal-body {
    padding: 9px !important;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 9px 9px !important;
    gap: 5px !important;
    flex-shrink: 0;
  }
}

/* Phone portrait (380x754) and (380x810) - specific optimizations */
/* Using range-based media query for Android compatibility */
@media (min-width: 375px) and (max-width: 385px) and (min-height: 750px) and (max-height: 820px) and (orientation: portrait),
(width: 380px) and (height: 754px) and (orientation: portrait),
(width: 380px) and (height: 810px) and (orientation: portrait) {
  .modal-overlay {
    padding: 1px !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 1px !important;
    max-height: 99.5vh !important;
    border-radius: 9px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 9px 9px 0 !important;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 13px !important;
  }

  .modal-close {
    width: 22px !important;
    height: 22px !important;
  }

  .modal-close svg {
    width: 12px !important;
    height: 12px !important;
  }

  .modal form,
  .modal-body {
    padding: 9px !important;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 9px 9px !important;
    gap: 5px !important;
    flex-shrink: 0;
  }
}

/* Phone portrait (390x844) - specific optimizations */
@media (width: 390px) and (height: 844px) and (orientation: portrait) {
  .modal-overlay {
    padding: 1px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 1px;
    max-height: 99.5vh;
    border-radius: 9px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 9px 9px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 13px;
  }

  .modal-close {
    width: 22px;
    height: 22px;
  }

  .modal-close svg {
    width: 12px;
    height: 12px;
  }

  .modal form,
  .modal-body {
    padding: 9px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 9px 9px;
    gap: 5px;
    flex-shrink: 0;
  }
}

/* Phone portrait (392x767) - specific optimizations */
@media (width: 392px) and (height: 767px) and (orientation: portrait),
(min-width: 390px) and (max-width: 394px) and (min-height: 765px) and (max-height: 769px) and (orientation: portrait) {
  .modal-overlay {
    padding: 1px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    margin: 1px;
    max-height: 99.5vh;
    border-radius: 9px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }

  .modal-header {
    padding: 8px 8px 0;
    flex-shrink: 0;
  }

  .modal-header h3 {
    font-size: 12px;
  }

  .modal-close {
    width: 21px;
    height: 21px;
  }

  .modal-close svg {
    width: 11px;
    height: 11px;
  }

  .modal form,
  .modal-body {
    padding: 8px;
    overflow-y: visible;
    flex: 1;
    min-height: 0;
  }

  .modal-actions {
    padding: 0 8px 8px;
    gap: 4px;
    flex-shrink: 0;
  }
}

@media (max-width: 360px) {
  .modal {
    margin: 5px;
    border-radius: 12px;
  }

  .modal-header {
    padding: 14px 14px 0;
  }

  .modal-header h3 {
    font-size: 15px;
  }

  .modal form,
  .modal-body {
    padding: 14px;
  }

  .modal-actions {
    padding: 0 14px 14px;
  }
}

/* Small phones landscape (short height) */
@media (orientation: landscape) and (max-height: 430px) and (max-width: 900px) {
  .modal-overlay {
    padding: 8px;
  }

  .modal {
    max-height: 98vh;
    border-radius: 12px;
  }

  .modal-header {
    padding: 12px 12px 0;
  }

  .modal-header h3 {
    font-size: 15px;
  }

  .modal-close {
    width: 28px;
    height: 28px;
  }

  .modal form,
  .modal-body {
    padding: 12px;
  }

  .modal-actions {
    padding: 0 12px 12px;
    gap: 6px;
  }
}

@media (orientation: landscape) and (max-height: 320px) {
  .modal-header {
    padding: 10px 10px 0;
  }

  .modal-header h3 {
    font-size: 14px;
  }

  .modal form,
  .modal-body {
    padding: 10px;
  }

  .modal-actions {
    padding: 0 10px 10px;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}