*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --dodo-orange: #ff6900;
  --dodo-orange-hover: #e55f00;
  --text-primary: #1a1a1a;
  --text-secondary: #5c5c5c;
  --text-muted: #8c8c8c;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 4%), 0 1px 2px rgb(0 0 0 / 2%);
  --shadow-md: 0 4px 12px rgb(0 0 0 / 6%), 0 2px 4px rgb(0 0 0 / 4%);
  --radius-md: 10px;
  --radius-lg: 16px;
  --topbar-height: 60px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html,
body {
  min-height: 100vh;
}

body {
  margin: 0;
  background: var(--bg);
}

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

.main-content {
  min-height: 100vh;
  flex: 1;
  min-width: 0;
  background: var(--bg);
}

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

.topbar {
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-brand-link {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.topbar-brand-link:hover .product-name {
  color: var(--dodo-orange);
}

.brand-logo {
  width: 32px;
  height: 32px;
  display: block;
  flex: 0 0 auto;
  max-width: 32px;
  max-height: 32px;
  object-fit: cover;
  border-radius: 8px;
}

.product-name {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 12px;
  background: var(--bg);
  border-radius: var(--radius-md);
}

.user-avatar {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: white;
  font-size: 12px;
  font-weight: 600;
  background: var(--dodo-orange);
  border-radius: 8px;
}

.user-name {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-form {
  margin: 0;
}

.logout-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  color: #46556d;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid #d6dde8;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.logout-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logout-button:hover {
  color: #ff5b00;
  border-color: #ffb184;
}

.logout-button:focus-visible {
  outline: 3px solid rgb(255 105 0 / 18%);
  outline-offset: 2px;
}

.content-area {
  max-width: 1600px;
  padding: 24px;
  background: var(--bg);
}

.page-header {
  margin-bottom: 24px;
}

.page-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.page-subtitle {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.application-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.application-card {
  display: flex;
  min-height: 170px;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  color: inherit;
  text-align: left;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.application-card:hover {
  border-color: var(--dodo-orange);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.application-card:focus-visible {
  outline: 3px solid rgb(255 105 0 / 18%);
  outline-offset: 2px;
}

.application-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.application-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dodo-orange);
  font-size: 16px;
  font-weight: 800;
  background: #fff4ec;
  border: 1px solid #ffd8bf;
  border-radius: 10px;
}

.application-name {
  margin-top: 20px;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}

.application-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 40px;
  margin-top: 24px;
  padding: 10px 18px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  background: var(--dodo-orange);
  border: 1px solid var(--dodo-orange);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.application-card:hover .application-action {
  background: var(--dodo-orange-hover);
  border-color: var(--dodo-orange-hover);
  box-shadow: 0 4px 10px rgb(0 0 0 / 8%);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-orange {
  color: var(--dodo-orange);
  background: #fff1e8;
  border: 1px solid #ffd4b8;
}

.state-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 20px 24px;
  color: var(--text-secondary);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 700px) {
  .topbar {
    padding: 0 16px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .user-badge {
    max-width: 180px;
  }

  .logout-button {
    min-height: 38px;
    padding: 8px 11px;
  }

  .content-area {
    padding: 20px 16px;
  }

  .application-grid {
    grid-template-columns: 1fr;
  }

  .application-card {
    min-height: 156px;
  }
}
