/* ========================================
   Sidebar Layout
======================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: 250px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: white;
}

.sidebar .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
}

.sidebar .logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar .logo-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar .theme-toggle {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
  transition: all 0.3s ease;
}

.sidebar .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Auth Section */
.sidebar-auth {
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-auth-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 1.1rem;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border-radius: 0;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.82rem;
  line-height: 1.2;
  border: none;
  transition: all 0.3s ease;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
}

.sidebar-auth-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
}

.sidebar-user-info .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85rem;
}

.sidebar-user-info .user-name {
  color: white;
  font-weight: 500;
  font-size: 0.85rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 80, 80, 0.15);
  color: #ff8a8a;
  border: none;
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  width: 100%;
}

.sidebar-logout-btn:hover {
  background: rgba(255, 80, 80, 0.3);
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.nav-section-label {
  padding: 0.5rem 1.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.2;
  box-sizing: border-box;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  box-sizing: border-box;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-right: 3px solid white;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 250px;
  min-height: 100vh;
  padding: 2rem;
}

.content-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.content-panel.active {
  display: block;
}

/* Dashboard Styles (integrated) */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dash-stat-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.dash-stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.dash-stat-card .stat-icon.files {
  background: #fff0f0;
  color: #cc0000;
}

.dash-stat-card .stat-icon.folders {
  background: #fff8e6;
  color: #e6a817;
}

.dash-stat-card .stat-icon.links {
  background: #e6f7ff;
  color: #0066cc;
}

.dash-stat-card .stat-icon.views {
  background: #f0fff0;
  color: #228b22;
}

.dash-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.dash-section-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.dash-section-tab {
  flex: 1;
  padding: 0.8rem;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-muted);
  border: none;
  background: none;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
  font-family: inherit;
}

.dash-section-tab.active {
  color: var(--primary);
  background: var(--primary-light);
  border-bottom-color: var(--primary);
}

.dash-section-tab i {
  margin-right: 0.4rem;
}

.dash-section-panel {
  display: none;
}

.dash-section-panel.active {
  display: block;
}

.items-table {
  background: var(--bg-secondary);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.table-header h3 {
  font-size: 1rem;
  color: var(--text-primary);
}

.table-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.item-row {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
  gap: 1rem;
}

.item-row:hover {
  background: var(--primary-light);
}

.item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.item-icon.file {
  background: #fff0f0;
  color: #cc0000;
}

.item-icon.folder {
  background: #fff8e6;
  color: #e6a817;
}

.item-icon.url {
  background: #e6f7ff;
  color: #0066cc;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.item-meta span i {
  margin-right: 0.3rem;
}

.item-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.action-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s;
  color: var(--text-muted);
}

.action-btn:hover {
  background: var(--primary-light);
}

.action-btn.delete:hover {
  background: #fff0f0;
  color: #cc0000;
  border-color: #ffcccc;
}

.action-btn.password:hover {
  background: #fff8e6;
  color: #e6a817;
  border-color: #ffe6a0;
}

.action-btn.copy:hover {
  background: #e6f7ff;
  color: #0066cc;
  border-color: #b3d9ff;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state p {
  font-size: 0.95rem;
}

.dash-loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.dash-loading i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

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

.modal {
  background: var(--bg-secondary);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.modal h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.modal input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  margin-bottom: 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.modal input:focus {
  border-color: var(--primary);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s;
}

.modal-btn.cancel {
  background: var(--bg-primary);
  color: var(--text-secondary);
}

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

.modal-btn.remove {
  background: #888;
  color: white;
}

/* Content Panel Title */
.panel-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.panel-title i {
  color: rgba(255, 255, 255, 0.85);
}

/* Mobile hamburger */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
  .mobile-toggle {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 4rem 1rem 2rem;
  }

  .dash-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .item-row {
    flex-wrap: wrap;
  }

  .item-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Hide reCAPTCHA v3 badge (Google requires text attribution instead) */
.grecaptcha-badge {
  visibility: hidden !important;
}