/* SiteYönetim — Layout: Sidebar + Header + Content */

/* App shell */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar styles are now inline in sidebar.php ── */

/* ── Mobile Bottom Nav Bar ── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding: var(--space-2) 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.mobile-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-4);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.625rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
  min-width: 52px;
}

.mobile-bottom-nav-item svg {
  width: 20px;
  height: 20px;
}

.mobile-bottom-nav-item.active {
  color: var(--primary);
}

.mobile-bottom-nav-item .nav-badge {
  position: absolute;
  top: 0;
  right: var(--space-2);
  background: var(--danger);
  color: #fff;
  font-size: 0.55rem;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 7px;
  padding: 0 3px;
}

/* ── Main area — sidebar margin handled in sidebar.php inline styles ── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ── */
.app-header {
  height: var(--header-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.header-panel-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.header-panel-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.header-panel-welcome {
  font-size: .65rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.header-panel-welcome strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* Tenant Switcher */
.tenant-switcher-dropdown { position: relative; }

.tenant-switcher-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--text-primary);
  transition: all 0.15s;
  max-width: 260px;
}

.tenant-switcher-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.tenant-switcher-icon { font-size: 1.125rem; line-height: 1; flex-shrink: 0; }
.tenant-switcher-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant-switcher-arrow { flex-shrink: 0; color: var(--text-secondary); }

.tenant-switcher-menu {
  min-width: 280px;
  max-height: 400px;
  overflow-y: auto;
}

.tenant-switcher-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.tenant-switch-item {
  display: flex !important;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem !important;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.tenant-switch-item.active {
  background: var(--primary-light);
}

.tenant-switch-item:hover {
  background: var(--bg-tertiary);
}

.tsi-icon { font-size: 1.25rem; flex-shrink: 0; }
.tsi-info { flex: 1; min-width: 0; }
.tsi-name { display: block; font-weight: 600; font-size: 0.8125rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsi-location { display: block; font-size: 0.6875rem; color: var(--text-muted); }
.tsi-check { flex-shrink: 0; color: var(--primary); }

.tenant-add-item {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary) !important;
  font-weight: 500;
}

/* Role Switcher */
.role-switcher-section {
  padding: 0.25rem 0;
}

.role-switcher-label {
  padding: 0.375rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-switch-item {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem !important;
  cursor: pointer;
  width: 100%;
  border: none;
  background: none;
  font-size: 0.8125rem;
}

.role-switch-item.active {
  background: var(--primary-50, #eff6ff);
  color: var(--primary);
}

.role-switch-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.role-switch-name {
  flex: 1;
  font-weight: 500;
  text-align: left;
}

.role-switch-tenant {
  font-size: 0.6875rem;
  color: var(--text-muted);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-switch-check {
  flex-shrink: 0;
  color: var(--primary);
}

/* Notification bell */
.header-notification {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
}

.header-notification:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* notification-count styles are in components.css */

/* User menu */
.header-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.header-user:hover {
  background: var(--bg-tertiary);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.user-info {
  line-height: 1.3;
}

.user-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ── Content ── */
.content-area {
  flex: 1;
  padding: var(--space-xl);
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.page-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  list-style: none;
  padding: 0;
}

.breadcrumb-item a {
  color: var(--text-secondary);
}

.breadcrumb-item a:hover {
  color: var(--primary);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 500;
}

.breadcrumb-separator {
  color: var(--text-muted);
}

/* Breadcrumb Bar (auto-generated) */
.breadcrumb-bar {
  padding: 0.5rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.breadcrumb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-secondary);
}
.breadcrumb-item a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb-item a:hover {
  color: var(--primary);
}
.breadcrumb-item.active span {
  color: var(--text-primary);
  font-weight: 500;
}
.breadcrumb-sep {
  flex-shrink: 0;
  color: var(--text-muted);
}

/* ── Footer ── */
.app-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
}

/* Auth layout (login/register) */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  padding: var(--space-xl);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-xs);
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-xl);
}

/* Landing layout */
.landing-layout {
  min-height: 100vh;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.landing-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
}

/* ── Header Search ── */
.header-search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.header-search-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.header-search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--bg-primary);
  padding: var(--space-sm) var(--space-md);
  box-shadow: var(--shadow-lg);
  border-bottom: 1px solid var(--border);
}
.header-search-overlay.active {
  display: flex;
}
.header-search-form {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}
.header-search-input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
}
.header-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.header-search-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
}
.header-search-close:hover {
  color: var(--danger);
}
