/* ========================================================
   Backup Service Admin – Panel Styles
   Color de marca: #f15e22
   ======================================================== */

:root {
  --brand:           #f15e22;
  --brand-hover:     #d94e15;
  --brand-light:     rgba(241, 94, 34, 0.09);
  --brand-border:    rgba(241, 94, 34, 0.25);
  --sidebar-width:   250px;
  --sidebar-bg:      #ffffff;
  --topbar-h:        60px;
  --topbar-bg:       #ffffff;
  --body-bg:         #f4f5f7;
  --border:          #e9ecef;
  --text-secondary:  #6c757d;
  --radius:          10px;
  --shadow-sm:       0 1px 4px rgba(0,0,0,0.07);
  --shadow-md:       0 4px 16px rgba(0,0,0,0.1);
}

/* ── Layout ──────────────────────────────────────────── */
body {
  background-color: var(--body-bg);
  min-height: 100vh;
  font-size: .9rem;
}

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-sm);
}

.sidebar-brand {
  height: var(--topbar-h);
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-nav {
  padding: .75rem .6rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-secondary);
  padding: .7rem .7rem .25rem;
  margin-top: .25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  border-radius: 8px;
  color: #495057;
  text-decoration: none;
  font-size: .855rem;
  font-weight: 500;
  transition: background .18s ease, color .18s ease;
  margin-bottom: 2px;
}

.sidebar-link i {
  font-size: 1.05rem;
  width: 1.2rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background-color: var(--brand-light);
  color: var(--brand);
}

.sidebar-link.active {
  background-color: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
  border-left: 3px solid var(--brand);
  padding-left: calc(.75rem - 3px);
}

.sidebar-footer {
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  color: var(--text-secondary);
}

/* ── Main Content ────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  gap: .75rem;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  font-size: .88rem;
  font-weight: 600;
  color: #343a40;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Page Content ────────────────────────────────────── */
.page-content {
  padding: 1.5rem;
  flex: 1;
}

/* ── Stats Cards ─────────────────────────────────────── */
.stat-card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  color: #212529;
}

.stat-label {
  font-size: .78rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Notifications Dropdown ──────────────────────────── */
.notif-dropdown {
  min-width: 320px;
  border-radius: 12px !important;
  overflow: hidden;
  border: none !important;
  box-shadow: var(--shadow-md) !important;
  padding: 0 !important;
}

.notif-item {
  border-bottom: 1px solid #f5f5f5;
  transition: background .15s ease;
}

.notif-item:hover {
  background-color: #fafafa;
}

.notif-item.unread {
  background-color: #fffaf7;
}

/* ── User Avatar ─────────────────────────────────────── */
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Cards (generic) ─────────────────────────────────── */
.panel-card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
}

/* ── Table ───────────────────────────────────────────── */
.panel-table th {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
  background-color: #fafafa;
  border-bottom: 2px solid var(--border) !important;
  white-space: nowrap;
}

.panel-table td {
  vertical-align: middle;
  border-color: var(--border);
  font-size: .855rem;
}

.panel-table tbody tr:hover {
  background-color: rgba(0,0,0,.018);
}

/* ── Batch toolbar ───────────────────────────────────── */
.batch-toolbar {
  background: var(--brand-light);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  padding: .7rem 1rem;
}

/* ── Checkboxes (brand color) ────────────────────────── */
.form-check-input {
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
  border: 2px solid #ced4da;
  transition: all .15s ease;
  flex-shrink: 0;
}

.form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
  transform: scale(1.08);
}

.form-check-input:focus {
  box-shadow: 0 0 0 .2rem rgba(241,94,34,.18);
  border-color: var(--brand);
}

.form-check-input:indeterminate {
  background-color: var(--brand);
  border-color: var(--brand);
}

/* ── Forms ───────────────────────────────────────────── */
.form-select,
.form-control {
  border-radius: 8px;
  border-color: #dee2e6;
  font-size: .855rem;
}

.form-select:focus,
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(241,94,34,.14);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn-brand {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-brand:hover,
.btn-brand:focus {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #fff;
}

/* Override Bootstrap primary to use brand color */
.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
  border-color: var(--brand);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-hover) 0%, #c0400f 100%);
  border-color: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(241,94,34,.25);
}

/* ── Nav pills (tab switcher) ────────────────────────── */
.tab-switcher {
  background: #f0f2f5;
  padding: 4px;
  border-radius: 10px;
  display: inline-flex;
}

.tab-switcher .nav-link {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: .845rem;
  border-radius: 8px;
  padding: .45rem 1.1rem;
  transition: all .2s ease;
  border: 1px solid transparent;
}

.tab-switcher .nav-link:hover:not(.active) {
  color: var(--brand);
  background: rgba(241,94,34,.06);
}

.tab-switcher .nav-link.active {
  background: #fff;
  color: var(--brand) !important;
  border-color: var(--brand-border) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ── Pagination ──────────────────────────────────────── */
.pagination .page-link {
  border-radius: 8px !important;
  margin: 0 2px;
  border: 1px solid var(--border);
  color: #495057;
  font-size: .82rem;
  padding: .35rem .65rem;
  transition: all .15s ease;
}

.pagination .page-item.active .page-link {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.pagination .page-link:hover {
  background-color: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand-border);
}

/* ── Badges (file type) ──────────────────────────────── */
.badge-file-type {
  font-size: .7rem;
  font-weight: 600;
  padding: .3em .65em;
  border-radius: 6px;
}

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 3rem;
  opacity: .35;
  display: block;
  margin-bottom: .75rem;
}

/* ── Loading overlay ─────────────────────────────────── */
#loadingOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

/* ── Alerts ──────────────────────────────────────────── */
.alert {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ── Breadcrumb ──────────────────────────────────────── */
.breadcrumb-item + .breadcrumb-item::before {
  color: #adb5bd;
}

.breadcrumb-item a {
  color: var(--brand);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

/* ── Progress bar ────────────────────────────────────── */
.progress {
  border-radius: 99px;
  background-color: #e9ecef;
}

/* ── Responsive: collapse sidebar on mobile ──────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 1039;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }
}
