.backup-management {
  background-color: var(--color-bg-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.backup-content {
  padding: 2rem;
  max-width: 100%;
  margin: 0 auto;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

.backup-page-header {
  margin-bottom: 2rem;
  text-align: center;
}

.backup-page-header h1 {
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
  font-size: 2.5rem;
}

.backup-page-header p {
  color: var(--color-text-secondary);
  font-size: 1.1rem;
}

.backup-message {
  padding: 1rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  font-weight: 500;
}

.backup-message.success {
  background-color: var(--color-success-light);
  color: var(--color-success-dark);
  border: 1px solid var(--color-success);
}

.backup-message.error {
  background-color: var(--color-danger-light);
  color: var(--color-danger-dark);
  border: 1px solid var(--color-danger);
}

.backup-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.backup-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Main Backup Actions - Compact Layout */
.main-backup-actions {
  display: grid;
  grid-template-columns: minmax(280px, 350px) minmax(280px, 350px) minmax(150px, 200px);
  gap: 1rem;
  align-items: start;
  overflow: visible;
  justify-content: center;
  max-width: 1000px;
  margin: 0 auto;
}

/* Ensure parent containers don't clip the dropdown */
.backup-actions-card {
  overflow: visible !important;
}

.backup-actions-card > * {
  overflow: visible !important;
}

/* Compact Button Style - Match Header Size */
.backup-btn,
.compact-btn {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: auto;
  width: fit-content;
}

/* Advanced Actions Menu */
.advanced-actions-menu {
  position: relative;
  padding: 1rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  max-width: 200px;
  width: 100%;
}

.advanced-actions-menu h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-secondary);
}

.dots-menu-btn {
  padding: 0.4rem 0.8rem;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.dots-menu-btn:hover {
  background: var(--color-bg-tertiary);
}

.dots-menu-btn span {
  font-weight: bold;
  margin-right: 0.5rem;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  margin-top: 0.25rem;
}

.dropdown-item {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.8rem;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.dropdown-item:hover:not(:disabled) {
  background: var(--color-bg-secondary);
}

.dropdown-item:disabled {
  color: var(--color-text-tertiary);
  cursor: not-allowed;
}

.dropdown-divider {
  margin: 0.25rem 0;
  border: none;
  border-top: 1px solid var(--color-border);
}

.backup-action-card {
  background: var(--color-bg-primary);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  border: 1px solid var(--color-border-light);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  overflow: visible;
  max-width: 350px;
  width: 100%;
}

.backup-action-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.backup-action-card h3 {
  color: var(--color-text-primary);
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.backup-action-card p {
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
  line-height: 1.4;
  font-size: 0.9rem;
}

.backup-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: auto;
  width: fit-content;
}

.backup-btn.database {
  background-color: var(--color-primary);
  color: white;
}

.backup-btn.database:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
}

.backup-btn.files {
  background-color: var(--color-warning);
  color: white;
}

.backup-btn.files:hover:not(:disabled) {
  background-color: var(--color-warning-dark);
}

.backup-btn.full {
  background-color: var(--color-info);
  color: white;
}

.backup-btn.full:hover:not(:disabled) {
  background-color: var(--color-info-dark);
}

.backup-btn.cleanup {
  background-color: #ffc107;
  color: var(--color-text-primary);
}

.backup-btn.cleanup:hover:not(:disabled) {
  background-color: #e0a800;
}

.backup-btn.cleanup-all {
  background-color: var(--color-danger);
  color: white;
}

.backup-btn.cleanup-all:hover:not(:disabled) {
  background-color: var(--color-danger-dark);
}

.backup-btn.upload {
  background-color: var(--color-info);
  color: white;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.backup-btn.upload:hover:not(.disabled) {
  background-color: var(--color-info-dark);
}

.backup-btn.upload.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--color-text-secondary);
}

.backup-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.backup-list {
  background: var(--color-bg-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.backup-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background-color: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-light);
}

.backup-list-header h2 {
  color: var(--color-text-primary);
  margin: 0;
  font-size: 1.5rem;
}

.refresh-btn {
  padding: 0.5rem 1rem;
  background-color: var(--color-text-secondary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.refresh-btn:hover:not(:disabled) {
  background-color: var(--color-text-primary);
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.backup-loading {
  padding: 3rem;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
}

.backup-table {
  overflow-x: auto;
  width: 100%;
  box-sizing: border-box;
}

.no-backups {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 1rem;
}

.backup-table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto; /* Changed from fixed to auto for better responsiveness */
  min-width: 600px; /* Minimum width to maintain readability */
}

.backup-table th {
  background-color: var(--color-bg-secondary);
  padding: 0.75rem 0.5rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-primary);
  border-bottom: 2px solid var(--color-border-light);
  white-space: nowrap;
  font-size: 0.85rem;
}

/* Responsive column widths - removed fixed percentages */

.backup-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 0.85rem;
  color: var(--color-text-primary);
}

.backup-table td:nth-child(2) {
  word-break: break-all;
  line-height: 1.4;
  max-width: 200px; /* Set a reasonable max width instead of 0 */
}

.backup-table tr:hover {
  background-color: var(--color-bg-secondary);
}

.backup-type {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.backup-type.database {
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.backup-type.files {
  background-color: var(--color-warning-light);
  color: var(--color-warning-dark);
}

.backup-type.full {
  background-color: var(--color-info-light);
  color: var(--color-info-dark);
}

.backup-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.backup-status.created {
  background-color: var(--color-success-light);
  color: var(--color-success-dark);
}

.backup-status.uploaded {
  background-color: var(--color-info-light);
  color: var(--color-info-dark);
}

.backup-status.failed {
  background-color: var(--color-danger-light);
  color: var(--color-danger-dark);
}

.backup-status.verified {
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.backup-status.missing {
  background-color: var(--color-danger-light);
  color: var(--color-danger-dark);
}

.backup-status.corrupted {
  background-color: var(--color-danger-light);
  color: var(--color-danger-dark);
}

.backup-status.size_mismatch {
  background-color: var(--color-warning-light);
  color: var(--color-warning-dark);
}

.backup-status.checksum_failed {
  background-color: var(--color-warning-light);
  color: var(--color-warning-dark);
}

.file-exists {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.file-exists.yes {
  background-color: var(--color-success-light);
  color: var(--color-success-dark);
}

.file-exists.no {
  background-color: var(--color-danger-light);
  color: var(--color-danger-dark);
}

.backup-actions-cell {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
}

.action-btn {
  padding: 0.5rem 0.8rem;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 70px;
  text-align: center;
  flex-shrink: 0;
}

/* Override AdminLayout.css conflicting rules */
.backup-actions-cell .action-btn {
  flex: none !important;
  min-width: 70px !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-wrap: normal !important;
}

.action-btn.download {
  background-color: var(--color-success);
  color: white;
}

.action-btn.download:hover {
  background-color: var(--color-success-dark);
}

.action-btn.verify {
  background-color: var(--color-info);
  color: white;
}

.action-btn.verify:hover {
  background-color: var(--color-info-dark);
}

.action-btn.restore {
  background-color: var(--color-warning);
  color: white;
}

.action-btn.restore:hover:not(:disabled) {
  background-color: var(--color-warning-dark);
}

.action-btn.restore:disabled {
  background-color: var(--color-text-secondary);
  cursor: not-allowed;
}

.action-btn.delete {
  background-color: var(--color-danger);
  color: white;
}

.action-btn.delete:hover {
  background-color: var(--color-danger-dark);
}

.upload-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Responsive Design - Sidebar-aware breakpoints */
/* Large desktop screens - sidebar + content fits comfortably */

/* Medium desktop - account for sidebar width (1024px - 280px = 744px content) */

/* Small desktop/large tablet - sidebar significantly reduces available width */

/* Small tablets and large mobile screens */

/* Mobile phone screens */

/* Very small mobile screens */

/* Dark theme specific adjustments */
[data-theme='dark'] .backup-action-card {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
}

[data-theme='dark'] .backup-action-card:hover {
  background: var(--color-bg-tertiary);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

[data-theme='dark'] .backup-list {
  background: var(--color-bg-secondary);
}

[data-theme='dark'] .backup-list-header {
  background-color: var(--color-bg-tertiary);
  border-bottom-color: var(--color-border);
}

[data-theme='dark'] .backup-table th {
  background-color: var(--color-bg-tertiary);
  border-bottom-color: var(--color-border);
}

[data-theme='dark'] .backup-table td {
  border-bottom-color: var(--color-border);
}

[data-theme='dark'] .backup-table tr:hover {
  background-color: var(--color-bg-tertiary);
}

[data-theme='dark'] .backup-btn.cleanup {
  color: var(--color-text-primary);
}

[data-theme='dark'] .no-backups {
  color: var(--color-text-muted);
}

/* Additional dark theme styles for new components */
[data-theme='dark'] .advanced-actions-menu {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border);
}

[data-theme='dark'] .dropdown-menu {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
}

[data-theme='dark'] .dots-menu-btn {
  background: var(--color-bg-primary);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

[data-theme='dark'] .dots-menu-btn:hover {
  background: var(--color-bg-secondary);
}

/* Tab Navigation Styles */
.backup-tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  border-bottom: 2px solid var(--color-border-light);
  padding: 0 1rem;
}

.tab-button {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  bottom: -2px;
  white-space: nowrap;
}

.tab-button:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
}

.tab-button.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.tab-button:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Unsaved changes indicator */
.unsaved-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.75rem;
}

.unsaved-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
  background-color: var(--color-warning);
  border-radius: 50%;
  animation: pulse-warning 1.5s ease-in-out infinite;
  box-shadow: 0 0 4px var(--color-warning);
  flex-shrink: 0;
}

.unsaved-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-warning);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes pulse-warning {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 4px var(--color-warning);
  }
  50% {
    transform: scale(1.3);
    opacity: 0.7;
    box-shadow: 0 0 8px var(--color-warning);
  }
}

/* Dark theme tab styles */
[data-theme='dark'] .backup-tabs {
  border-bottom-color: var(--color-border);
}

[data-theme='dark'] .tab-button:hover {
  background: var(--color-bg-tertiary);
}

/* Retention Settings Styles */
.retention-settings-card {
  margin-top: 1.5rem;
}

.retention-info-card {
  background-color: rgba(66, 135, 245, 0.05);
  border: 1px solid rgba(66, 135, 245, 0.2);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.retention-info-header h3 {
  color: #4287f5;
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.retention-info-list {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--color-text-primary);
  list-style-type: disc;
}

.retention-info-list li {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.retention-info-list li:last-child {
  margin-bottom: 0;
}

.retention-info-list li strong {
  color: #4287f5;
  font-weight: 600;
}

.retention-settings-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.retention-settings-form .setting-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border-light);
}

.retention-settings-form .setting-item:last-child {
  border-bottom: none;
}

.retention-settings-form .setting-info {
  flex: 1;
  margin-right: 2rem;
}

.retention-settings-form .setting-title {
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.retention-settings-form .setting-description {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.4;
}

.retention-settings-form .setting-control {
  flex-shrink: 0;
}

.retention-settings-form .input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-input {
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border-light);
  border-radius: 8px;
  font-size: 1rem;
  width: 100px;
  text-align: center;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.settings-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-suffix {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 60px;
}

.retention-settings-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--color-border-light);
}

.settings-btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
}

.settings-btn.primary {
  background-color: var(--color-primary);
  color: white;
}

.settings-btn.primary:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.settings-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.settings-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

/* Dark theme retention settings styles */
[data-theme='dark'] .retention-info-card {
  background-color: rgba(66, 135, 245, 0.1);
  border-color: rgba(66, 135, 245, 0.3);
}

[data-theme='dark'] .retention-settings-form .setting-item {
  border-bottom-color: var(--color-border);
}

[data-theme='dark'] .settings-input {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

[data-theme='dark'] .settings-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

[data-theme='dark'] .retention-settings-actions {
  border-top-color: var(--color-border);
}

/* Mobile responsive styles for tabs and settings */
@media (max-width: 768px) {
  .backup-tabs {
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-bottom: none;
  }

  .tab-button {
    width: 100%;
    text-align: left;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border-light);
    border-left: 3px solid transparent;
  }

  .tab-button.active {
    border-left-color: var(--color-primary);
    border-bottom-color: var(--color-border-light);
    background: var(--color-bg-secondary);
  }

  .retention-settings-form .setting-item {
    flex-direction: column;
    gap: 1rem;
  }

  .retention-settings-form .setting-info {
    margin-right: 0;
  }

  .retention-settings-form .setting-control {
    width: 100%;
  }

  .retention-settings-form .input-group {
    justify-content: space-between;
  }

  .settings-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .backup-tabs {
    margin-top: 1rem;
  }

  .tab-button {
    font-size: 0.9rem;
    padding: 0.875rem 1rem;
  }

  .retention-info-card {
    padding: 1rem;
  }

  .retention-info-header h3 {
    font-size: 1rem;
  }

  .retention-info-list {
    font-size: 0.875rem;
  }

  .retention-settings-form .setting-title {
    font-size: 1rem;
  }

  .retention-settings-form .setting-description {
    font-size: 0.875rem;
  }

  .settings-input {
    width: 80px;
    padding: 0.625rem 0.75rem;
    font-size: 0.9rem;
  }

  .input-suffix {
    font-size: 0.85rem;
  }
}

/* Mobile responsive for new compact layout */
