/*
 * ProDentory – Corporate Theme for Pico CSS v2
 *
 * Farben aus ProDentory_DIM_transp.png:
 *   Primary blue  (Zahn-Icon) : #4AAEE0
 *   Dark navy     (Schriftzug): #1C3557
 */

/* ── Custom properties ──────────────────────────────────────── */
:root {
  --pd-primary:        #4AAEE0;
  --pd-primary-dark:   #1C3557;
  --pd-primary-hover:  #3498D0;
  --pd-primary-light:  #EBF6FD;
  --pd-shadow-sm:      0 2px 8px  rgba(28, 53, 87, 0.09);
  --pd-shadow-md:      0 4px 20px rgba(28, 53, 87, 0.13);
  --pd-sidebar-w:      72px;
}

/* ── Pico v2 primary color overrides ────────────────────────── */
:root,
[data-theme="light"] {
  --pico-primary:                  var(--pd-primary);
  --pico-primary-background:       var(--pd-primary);
  --pico-primary-border:           var(--pd-primary);
  --pico-primary-underline:        rgba(74, 174, 224, 0.50);
  --pico-primary-hover:            var(--pd-primary-hover);
  --pico-primary-hover-background: var(--pd-primary-hover);
  --pico-primary-hover-border:     var(--pd-primary-hover);
  --pico-primary-focus:            rgba(74, 174, 224, 0.25);
  --pico-primary-inverse:          #ffffff;
}

/* ── Seitenstruktur ─────────────────────────────────────────── */
.pd-page-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── App-Layout mit Sidebar ─────────────────────────────────── */
.pd-app-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.pd-content {
  flex: 1;
  min-width: 0;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.pd-navbar {
  background-color: var(--pd-primary-dark);
  padding: 0.625rem 0;
  box-shadow: var(--pd-shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.pd-navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pd-navbar .pd-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.pd-navbar .pd-logo img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.pd-navbar nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pd-navbar nav a {
  color: rgba(255, 255, 255, 0.80);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--pico-border-radius, 0.375rem);
  transition: background 0.15s, color 0.15s;
}

.pd-navbar nav a:hover,
.pd-navbar nav a.active {
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.pd-navbar nav a.pd-nav-cta {
  background-color: var(--pd-primary);
  color: #ffffff;
  font-weight: 600;
}

.pd-navbar nav a.pd-nav-cta:hover {
  background-color: var(--pd-primary-hover);
}

.pd-navbar nav a.pd-nav-logout {
  border: 1px solid rgba(255, 255, 255, 0.40);
  color: rgba(255, 255, 255, 0.80);
}

.pd-navbar nav a.pd-nav-logout:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.65);
  color: #ffffff;
}

.pd-navbar .pd-nav-user {
  color: rgba(255, 255, 255, 0.60);
  font-size: 0.8rem;
  padding: 0.375rem 0.5rem;
}

/* ── Flash-Nachrichten ──────────────────────────────────────── */
.pd-messages {
  margin-top: 1rem;
}

.pd-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--pico-border-radius, 0.375rem);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  border-left: 4px solid transparent;
}

.pd-alert-success { background: #d4edda; color: #155724; border-color: #28a745; }
.pd-alert-error,
.pd-alert-danger   { background: #f8d7da; color: #721c24; border-color: #dc3545; }
.pd-alert-warning  { background: #fff3cd; color: #856404; border-color: #ffc107; }
.pd-alert-info     { background: #d1ecf1; color: #0c5460; border-color: #17a2b8; }

/* ── Sidebar ────────────────────────────────────────────────── */
.pd-sidebar {
  width: var(--pd-sidebar-w);
  background: var(--pd-primary-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.pd-sidebar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  gap: 0.5rem;
  width: 100%;
}

.pd-sidebar-title {
  color: rgba(255, 255, 255, 0.40);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 0.25rem;
}

.pd-sidebar-emp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-decoration: none;
  padding: 0.4rem 0.25rem;
  border-radius: 0.375rem;
  transition: background 0.15s;
  width: 58px;
}

.pd-sidebar-emp:hover {
  background: rgba(255, 255, 255, 0.10);
}

.pd-sidebar-emp.active {
  background: rgba(255, 255, 255, 0.18);
}

.pd-emp-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
}

.pd-sidebar-emp.active .pd-emp-avatar {
  border-color: var(--pd-primary);
}

.pd-emp-initials {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--pd-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  border: 2px solid transparent;
}

.pd-sidebar-emp.active .pd-emp-initials {
  border-color: #ffffff;
}

.pd-emp-kuerzel {
  color: rgba(255, 255, 255, 0.60);
  font-size: 0.6rem;
  text-align: center;
}

.pd-sidebar-divider {
  width: 40px;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0.25rem 0;
}

.pd-sidebar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.50);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.pd-sidebar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* ── Hero-Sektion ───────────────────────────────────────────── */
.pd-hero {
  background: linear-gradient(145deg, var(--pd-primary-dark) 0%, #2A5080 100%);
  color: #ffffff;
  padding: 5rem 0 4.5rem;
  text-align: center;
}

.pd-hero .pd-hero-logo {
  height: 80px;
  width: auto;
  margin-bottom: 1.5rem;
  filter: brightness(0) invert(1);
}

.pd-hero h1 {
  color: #ffffff;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.375rem;
}

.pd-hero .pd-tagline {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.pd-hero .pd-hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.pd-hero .pd-hero-actions a {
  min-width: 160px;
}

/* ── Feature-Cards ──────────────────────────────────────────── */
.pd-features {
  background: var(--pd-primary-light);
  padding: 4rem 0;
}

.pd-features h2 {
  text-align: center;
  color: var(--pd-primary-dark);
  margin-bottom: 2.5rem;
}

.pd-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
}

.pd-feature-card {
  background: #ffffff;
  border-radius: var(--pico-border-radius, 0.375rem);
  padding: 1.5rem;
  box-shadow: var(--pd-shadow-sm);
  border-top: 3px solid var(--pd-primary);
}

.pd-feature-icon {
  font-size: 1.75rem;
  margin-bottom: 0.625rem;
  display: block;
}

.pd-feature-card h3 {
  color: var(--pd-primary-dark);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.pd-feature-card p {
  color: var(--pico-muted-color, #6c757d);
  font-size: 0.84rem;
  margin: 0;
  line-height: 1.5;
}

/* ── Auth-Seiten ────────────────────────────────────────────── */
.pd-auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  background: var(--pd-primary-light);
  min-height: calc(100vh - 130px);
}

.pd-auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: var(--pico-border-radius, 0.375rem);
  box-shadow: var(--pd-shadow-md);
  padding: 2.5rem 2.25rem;
}

.pd-auth-logo {
  display: block;
  height: 56px;
  width: auto;
  margin: 0 auto 1.75rem;
}

.pd-auth-card h1 {
  text-align: center;
  color: var(--pd-primary-dark);
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
}

.pd-auth-card .pd-auth-links {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.875rem;
}

/* ── Footer ─────────────────────────────────────────────────── */
.pd-footer {
  background-color: var(--pd-primary-dark);
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  padding: 1rem 0;
  font-size: 0.8rem;
  margin-top: auto;
}

.pd-footer a {
  color: rgba(255, 255, 255, 0.70);
  text-decoration: none;
}

.pd-footer a:hover {
  color: #ffffff;
}

/* ── Dashboard ──────────────────────────────────────────────── */
.pd-dashboard {
  padding: 2.5rem 0 3rem;
  background: var(--pd-primary-light);
  min-height: calc(100vh - 130px);
}

.pd-dashboard-header {
  margin-bottom: 2rem;
}

.pd-dashboard-header h1 {
  color: var(--pd-primary-dark);
  margin-bottom: 0.25rem;
}

.pd-dashboard-header p {
  color: var(--pico-muted-color, #6c757d);
  margin: 0;
}

.pd-dashboard-section {
  margin-bottom: 0.5rem;
}

.pd-dashboard-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pd-primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.pd-tile-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
  .pd-tile-row { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 601px) and (max-width: 900px) {
  .pd-tile-row { grid-template-columns: repeat(3, 1fr); }
}

.pd-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  background: #ffffff;
  border-radius: var(--pico-border-radius, 0.375rem);
  padding: 1.5rem 1rem;
  min-height: 120px;
  text-decoration: none;
  color: var(--pd-primary-dark);
  box-shadow: var(--pd-shadow-sm);
  border: 1px solid rgba(28, 53, 87, 0.08);
  border-top: 3px solid var(--pd-primary);
  transition: box-shadow 0.18s, transform 0.15s, border-top-color 0.18s;
}

.pd-tile:hover {
  box-shadow: var(--pd-shadow-md);
  transform: translateY(-3px);
  border-top-color: var(--pd-primary-hover);
  color: var(--pd-primary-dark);
}

.pd-tile-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.pd-tile-label {
  font-weight: 600;
  font-size: 0.875rem;
  text-align: center;
  line-height: 1.3;
}

.pd-tile-admin {
  border-top-color: var(--pd-primary-dark);
}

.pd-tile-admin:hover {
  border-top-color: #2a5080;
}

.pd-tile-row-admin {
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(28, 53, 87, 0.12);
}

/* ── Seiten-Bereiche ────────────────────────────────────────── */
.pd-section {
  padding: 2rem 0 3rem;
}

.pd-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.pd-section-header h1 {
  color: var(--pd-primary-dark);
  margin: 0;
  font-size: 1.5rem;
}

.pd-breadcrumb {
  font-size: 0.8rem;
  color: var(--pico-muted-color, #6c757d);
  margin-bottom: 0.25rem;
}

.pd-breadcrumb a {
  color: var(--pd-primary);
  text-decoration: none;
}

/* ── Formular-Karte ─────────────────────────────────────────── */
.pd-form-card {
  background: #ffffff;
  border-radius: var(--pico-border-radius, 0.375rem);
  box-shadow: var(--pd-shadow-sm);
  padding: 2rem;
  max-width: 680px;
  border-top: 3px solid var(--pd-primary);
}

.pd-form-card h2 {
  color: var(--pd-primary-dark);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.pd-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .pd-form-row { grid-template-columns: 1fr; }
}

.pd-form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ── Tabellen ───────────────────────────────────────────────── */
.pd-table-wrapper {
  overflow-x: auto;
  border-radius: var(--pico-border-radius, 0.375rem);
  box-shadow: var(--pd-shadow-sm);
}

.pd-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.pd-table th {
  background: var(--pd-primary-dark);
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pd-table td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid rgba(28, 53, 87, 0.08);
  font-size: 0.875rem;
  vertical-align: middle;
}

.pd-table tr:last-child td {
  border-bottom: none;
}

.pd-table tr:hover td {
  background: var(--pd-primary-light);
}

.pd-table .td-actions {
  white-space: nowrap;
  text-align: right;
}

.pd-table .td-actions a,
.pd-table .td-actions button {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  margin-left: 0.25rem;
}

/* ── Status-Badges ──────────────────────────────────────────── */
.pd-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.pd-badge-ok    { background: #d4edda; color: #155724; }
.pd-badge-warn  { background: #fff3cd; color: #856404; }
.pd-badge-alert { background: #f8d7da; color: #721c24; }
.pd-badge-info  { background: #d1ecf1; color: #0c5460; }
.pd-badge-neu   { background: #e2d9f3; color: #4a2c8a; }

/* ── Karten-Grid ────────────────────────────────────────────── */
.pd-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.pd-card {
  background: #ffffff;
  border-radius: var(--pico-border-radius, 0.375rem);
  box-shadow: var(--pd-shadow-sm);
  padding: 1.5rem;
  border-top: 3px solid var(--pd-primary);
}

.pd-card h3 {
  color: var(--pd-primary-dark);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

/* ── Statistik-Kacheln ──────────────────────────────────────── */
.pd-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.pd-stat-card {
  background: #ffffff;
  border-radius: var(--pico-border-radius, 0.375rem);
  box-shadow: var(--pd-shadow-sm);
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--pd-primary);
}

.pd-stat-label {
  font-size: 0.75rem;
  color: var(--pico-muted-color, #6c757d);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.pd-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--pd-primary-dark);
  line-height: 1;
}

.pd-stat-card.warn  { border-color: #ffc107; }
.pd-stat-card.alert { border-color: #dc3545; }

/* ── Leer-Zustand ───────────────────────────────────────────── */
.pd-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--pico-muted-color, #6c757d);
}

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

/* ── Admin-Bereich ──────────────────────────────────────────── */
.pd-admin-header {
  background: var(--pd-primary-dark);
  color: #fff;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

.pd-admin-header h1 {
  color: #fff;
  margin: 0;
  font-size: 1.4rem;
}

.pd-admin-header p {
  color: rgba(255,255,255,0.65);
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
}

/* ── Avatar-Vorschau ────────────────────────────────────────── */
.pd-avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--pd-primary);
  display: block;
  margin-bottom: 0.5rem;
}

/* ── Warenkorb ──────────────────────────────────────────────── */
.pd-cart-summary {
  background: #fff;
  border-radius: var(--pico-border-radius, 0.375rem);
  box-shadow: var(--pd-shadow-md);
  padding: 1.5rem;
  position: sticky;
  top: 80px;
}
