/**
 * Layout principal: sidebar + dashboard (design system)
 */

body.ds-layout {
  background: var(--ds-surface);
  font-family: var(--ds-font);
}

body.ds-layout .main-content-container {
  padding: 0;
  background: var(--ds-surface);
}

body.ds-layout .main-footer {
  background: var(--ds-surface-alt);
  color: var(--ds-text-muted);
  border-top: 1px solid var(--ds-border);
}

/* ---- Sidebar ---- */
.ds-sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: var(--ds-surface-alt);
  box-shadow: var(--ds-shadow-md);
  display: flex;
  flex-direction: column;
  transition: left var(--ds-transition);
  z-index: 1000;
  overflow-y: auto;
}

.ds-sidebar.active {
  left: 0;
}

.ds-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ds-space-lg) var(--ds-space-md);
  min-height: 56px;
  border-bottom: 1px solid var(--ds-border);
}

.ds-sidebar-logo {
  width: 40px;
  height: 40px;
  background: var(--ds-primary);
  border-radius: var(--ds-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ds-surface);
  font-size: 1.25rem;
  text-decoration: none;
}

.ds-sidebar-logo.ds-sidebar-logo-img {
  width: auto;
  height: 44px;
  min-width: 0;
  background: transparent;
  padding: 0;
}

.ds-sidebar-logo.ds-sidebar-logo-img img {
  height: 100%;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

.ds-sidebar-toggle {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--ds-text-muted);
  cursor: pointer;
  border-radius: var(--ds-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ds-transition), color var(--ds-transition);
}

.ds-sidebar-toggle:hover {
  background: var(--ds-surface-active);
  color: var(--ds-text);
}

.ds-sidebar-nav {
  flex: 1;
  padding: var(--ds-space-md) 0;
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-lg);
}

.ds-sidebar-section {
  padding: 0 var(--ds-space-md);
}

.ds-sidebar-section-title {
  font-family: var(--ds-font);
  font-size: var(--ds-text-xs);
  font-weight: var(--ds-weight-medium);
  color: var(--ds-text-caption);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--ds-space-sm);
  padding: 0 var(--ds-space-sm);
}

.ds-sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--ds-space-md);
  padding: var(--ds-space-sm) var(--ds-space-sm);
  color: var(--ds-text);
  text-decoration: none;
  font-size: var(--ds-text-md);
  font-weight: var(--ds-weight-regular);
  border-radius: var(--ds-radius-md);
  transition: background var(--ds-transition), color var(--ds-transition);
  margin-bottom: 2px;
}

.ds-sidebar-link i {
  width: 20px;
  text-align: center;
  color: var(--ds-text-muted);
  font-size: 1.1rem;
}

.ds-sidebar-link:hover {
  background: var(--ds-surface-active);
  color: var(--ds-text);
}

.ds-sidebar-link:hover i {
  color: var(--ds-text);
}

.ds-sidebar-link.active {
  background: var(--ds-surface-active);
  color: var(--ds-text);
  font-weight: var(--ds-weight-medium);
}

.ds-sidebar-link.active i {
  color: var(--ds-text);
}

.ds-sidebar-account {
  padding: var(--ds-space-md);
  border-top: 1px solid var(--ds-border);
  margin-top: auto;
}

.ds-sidebar-account-user {
  display: flex;
  align-items: center;
  gap: var(--ds-space-md);
  margin-bottom: var(--ds-space-sm);
}

.ds-sidebar-account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ds-surface-active);
}

.ds-sidebar-account-info {
  flex: 1;
  min-width: 0;
}

.ds-sidebar-account-name {
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ds-sidebar-account-role {
  font-size: var(--ds-text-xs);
  color: var(--ds-text-caption);
}

.ds-sidebar-account-settings {
  display: flex;
  align-items: center;
  gap: var(--ds-space-sm);
  padding: var(--ds-space-sm) var(--ds-space-sm);
  color: var(--ds-text-muted);
  text-decoration: none;
  font-size: var(--ds-text-sm);
  border-radius: var(--ds-radius-sm);
  transition: background var(--ds-transition), color var(--ds-transition);
}

.ds-sidebar-account-settings:hover {
  background: var(--ds-surface-active);
  color: var(--ds-text);
}

.ds-sidebar-close {
  position: absolute;
  top: var(--ds-space-md);
  right: var(--ds-space-md);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--ds-text-muted);
  cursor: pointer;
  border-radius: var(--ds-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ds-transition), color var(--ds-transition);
}

.ds-sidebar-close:hover {
  background: var(--ds-surface-active);
  color: var(--ds-text);
}

/* Overlay quando sidebar aberta (mobile) */
.ds-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--ds-transition), visibility var(--ds-transition);
  z-index: 999;
}

.ds-sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Botão toggle fora da sidebar (flutuante) */
.ds-sidebar-open-btn {
  position: fixed;
  top: var(--ds-space-md);
  left: var(--ds-space-md);
  width: 44px;
  height: 44px;
  border: none;
  background: var(--ds-surface);
  color: var(--ds-text);
  cursor: pointer;
  border-radius: var(--ds-radius-md);
  box-shadow: var(--ds-shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: background var(--ds-transition), box-shadow var(--ds-transition);
}

.ds-sidebar-open-btn:hover {
  background: var(--ds-surface-alt);
  box-shadow: var(--ds-shadow-lg);
}

/* ---- Main content (dashboard) ---- */
.ds-main-wrap {
  min-height: 100vh;
  background: var(--ds-surface);
  margin-left: 0;
  transition: margin-left var(--ds-transition);
}

.ds-main-header {
  background: var(--ds-surface);
  border-bottom: 1px solid var(--ds-border);
  padding: var(--ds-space-md) var(--ds-space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--ds-space-md);
}

.ds-breadcrumb {
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
}

.ds-breadcrumb a {
  color: var(--ds-text-muted);
  text-decoration: none;
}

.ds-breadcrumb a:hover {
  color: var(--ds-text);
}

.ds-breadcrumb-sep {
  margin: 0 var(--ds-space-sm);
  color: var(--ds-border);
}

.ds-header-actions {
  display: flex;
  align-items: center;
  gap: var(--ds-space-md);
}

.ds-header-icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--ds-text-muted);
  cursor: pointer;
  border-radius: var(--ds-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ds-transition), color var(--ds-transition);
}

.ds-header-icon-btn:hover {
  background: var(--ds-surface-alt);
  color: var(--ds-text);
}

.ds-page {
  padding: var(--ds-space-xl);
  max-width: 1400px;
  margin: 0 auto;
}

.ds-page-header {
  margin-bottom: var(--ds-space-xl);
}

.ds-page-title {
  font-size: var(--ds-text-xxl);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-text);
  margin-bottom: var(--ds-space-xs);
}

.ds-page-desc {
  font-size: var(--ds-text-md);
  color: var(--ds-text-muted);
  margin-bottom: var(--ds-space-lg);
}

.ds-page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-md);
  margin-bottom: var(--ds-space-xl);
}

.ds-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-sm);
  padding: var(--ds-space-sm) var(--ds-space-lg);
  background: var(--ds-primary);
  color: var(--ds-surface);
  border: none;
  border-radius: var(--ds-radius-md);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-medium);
  cursor: pointer;
  transition: background var(--ds-transition);
}

.ds-btn-primary:hover {
  background: var(--ds-primary-hover);
}

.ds-search-wrap {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  position: relative;
}

.ds-search-wrap i {
  position: absolute;
  left: var(--ds-space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--ds-text-caption);
  font-size: var(--ds-text-md);
}

.ds-search-input {
  width: 100%;
  padding: var(--ds-space-sm) var(--ds-space-md) var(--ds-space-sm) 2.5rem;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  font-size: var(--ds-text-sm);
  font-family: var(--ds-font);
  background: var(--ds-surface);
  color: var(--ds-text);
  transition: border-color var(--ds-transition);
}

.ds-search-input::placeholder {
  color: var(--ds-text-caption);
}

.ds-search-input:focus {
  outline: none;
  border-color: var(--ds-primary);
}

.ds-section {
  margin-bottom: var(--ds-space-xl);
}

.ds-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--ds-space-md);
  margin-bottom: var(--ds-space-lg);
}

.ds-section-title {
  font-size: var(--ds-text-lg);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-text);
}

.ds-btn-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-sm);
  padding: var(--ds-space-sm) var(--ds-space-md);
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  color: var(--ds-text);
  border-radius: var(--ds-radius-md);
  font-size: var(--ds-text-sm);
  cursor: pointer;
  transition: background var(--ds-transition), border-color var(--ds-transition);
}

.ds-btn-filter:hover {
  background: var(--ds-surface-alt);
  border-color: var(--ds-text-caption);
}

.ds-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--ds-space-lg);
}

.ds-card {
  background: var(--ds-surface);
  border-radius: var(--ds-radius-md);
  box-shadow: var(--ds-shadow-sm);
  border: 1px solid var(--ds-border);
  padding: var(--ds-space-lg);
  transition: box-shadow var(--ds-transition);
}

.ds-card:hover {
  box-shadow: var(--ds-shadow-md);
}

.ds-card-accent-lavender { background: var(--ds-accent-lavender); border-color: transparent; }
.ds-card-accent-peach { background: var(--ds-accent-peach); border-color: transparent; }
.ds-card-accent-coral { background: var(--ds-accent-coral); border-color: transparent; }
.ds-card-accent-mint { background: var(--ds-accent-mint); border-color: transparent; }
.ds-card-accent-violet { background: var(--ds-accent-violet); border-color: transparent; }

.ds-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--ds-surface);
  border-radius: var(--ds-radius-sm);
  font-size: var(--ds-text-sm);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-text);
  margin-bottom: var(--ds-space-md);
}

.ds-card-title {
  font-size: var(--ds-text-md);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-text);
  margin-bottom: var(--ds-space-xs);
}

.ds-card-subtitle {
  font-size: var(--ds-text-sm);
  color: var(--ds-text-muted);
  margin-bottom: var(--ds-space-sm);
}

.ds-card-meta {
  font-size: var(--ds-text-xs);
  color: var(--ds-text-caption);
}

.ds-calendar-strip {
  display: flex;
  gap: var(--ds-space-sm);
  overflow-x: auto;
  padding-bottom: var(--ds-space-sm);
  margin-bottom: var(--ds-space-lg);
}

.ds-calendar-strip-btn {
  flex-shrink: 0;
  padding: var(--ds-space-sm) var(--ds-space-md);
  border: none;
  background: var(--ds-surface-alt);
  color: var(--ds-text);
  border-radius: var(--ds-radius-md);
  font-size: var(--ds-text-sm);
  cursor: pointer;
  transition: background var(--ds-transition), color var(--ds-transition);
}

.ds-calendar-strip-btn:hover {
  background: var(--ds-surface-active);
}

.ds-calendar-strip-btn.active {
  background: var(--ds-primary);
  color: var(--ds-surface);
}
