:root {
  --psk-green: #10B981;
  --psk-orange: #F97316;
  --psk-dark: #1F2937;
  --psk-bg: #F3F4F6;
  --psk-white: #FFFFFF;
  --psk-gray-text: #6B7280;
  --psk-border: #E5E7EB;
  --psk-radius: 16px;
  --psk-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --psk-transition: all 0.2s ease;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background-color: var(--psk-bg);
  color: var(--psk-dark);
}

.app-header {
  background: var(--psk-white);
  padding: 16px 0;
  border-bottom: 1px solid var(--psk-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.app-nav-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  color: var(--psk-dark);
}

.app-logo img {
  width: 32px;
  height: 32px;
  display: block;
}

.app-logo-text {
  font-size: 1.05rem;
  line-height: 1;
}

.app-logo-accent {
  color: var(--psk-green);
  margin-left: 4px;
}

.app-user {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.app-user-greeting {
  font-size: 0.9rem;
  color: var(--psk-dark);
}

.app-user-greeting strong {
  font-weight: 700;
}

.app-avatar {
  width: 36px;
  height: 36px;
  background: var(--psk-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  user-select: none;
}

.app-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--psk-white);
  border: 1px solid var(--psk-border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  padding: 6px;
  z-index: 200;
}

.app-user-menu a,
.app-user-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  color: var(--psk-dark);
  text-decoration: none;
  font-size: 0.9rem;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
}

.app-user-menu a:hover,
.app-user-menu button:hover {
  background: var(--psk-bg);
}

.app-lang {
  display: inline-flex;
  gap: 2px;
  background: var(--psk-bg);
  border-radius: 8px;
  padding: 2px;
}

.app-lang button {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--psk-gray-text);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.app-lang button.active {
  background: var(--psk-white);
  color: var(--psk-dark);
  box-shadow: var(--psk-shadow);
}

.app-auth-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.app-auth-links a {
  text-decoration: none;
  color: var(--psk-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.app-auth-links a.primary {
  background: var(--psk-green);
  color: white;
  padding: 8px 16px;
  border-radius: 10px;
}

/* Dashboard header */
.dashboard-header {
  margin: 40px 0 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.dashboard-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
}

.dashboard-subtitle {
  color: var(--psk-gray-text);
  margin-top: 4px;
}

.btn-add {
  background-color: var(--psk-orange);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--psk-transition);
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.25);
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-add:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  color: white;
}

.btn-add .plus {
  font-size: 1.25rem;
  line-height: 1;
}

/* Search bar */
.search-bar {
  background: var(--psk-white);
  padding: 12px 20px;
  border-radius: var(--psk-radius);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  border: 1px solid var(--psk-border);
}

.search-bar input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 1rem;
  font-family: inherit;
  background: transparent;
  color: var(--psk-dark);
}

.search-bar svg {
  color: #9CA3AF;
  flex-shrink: 0;
}

/* Group cards grid */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.group-card {
  background: var(--psk-white);
  border-radius: var(--psk-radius);
  overflow: hidden;
  border: 1px solid var(--psk-border);
  transition: var(--psk-transition);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.group-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border-color: var(--psk-green);
  color: inherit;
}

.group-cover {
  height: 140px;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
  font-weight: 800;
}

.group-cover.has-img {
  background-size: cover;
  background-position: center;
}

.group-cover-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
}

.group-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.group-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.group-desc {
  font-size: 0.9rem;
  color: var(--psk-gray-text);
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.group-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #F3F4F6;
}

.member-stack {
  display: flex;
  align-items: center;
}

.member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--psk-white);
  margin-left: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
}

.member-avatar:first-child {
  margin-left: 0;
}

.member-count {
  font-size: 0.8rem;
  color: var(--psk-gray-text);
  margin-left: 8px;
}

.vouchers-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--psk-green);
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.empty-state {
  background: var(--psk-white);
  border: 1px solid var(--psk-border);
  border-radius: var(--psk-radius);
  padding: 48px 24px;
  text-align: center;
}

.empty-state p {
  color: var(--psk-gray-text);
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .app-user-greeting { display: none; }
  .dashboard-header { flex-direction: column; align-items: flex-start; }
  .dashboard-header h1 { font-size: 1.6rem; }
}

.app-notif {
  position: relative;
}

.app-notif-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--psk-dark);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.app-notif-btn:hover { background: var(--psk-bg); }

.app-notif-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--psk-orange);
  color: white;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.app-notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--psk-white);
  border: 1px solid var(--psk-border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  min-width: 340px;
  max-width: 380px;
  z-index: 200;
  overflow: hidden;
}

.app-notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--psk-border);
  font-size: 0.9rem;
}

.app-notif-mark-all {
  background: none;
  border: none;
  color: var(--psk-green);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0;
}
.app-notif-mark-all:hover { text-decoration: underline; }

.app-notif-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--psk-gray-text);
  font-size: 0.9rem;
}

.app-notif-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 420px;
  overflow-y: auto;
}

.app-notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #F3F4F6;
}
.app-notif-item:last-child { border-bottom: none; }

.app-notif-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  text-decoration: none;
  color: var(--psk-dark);
  min-width: 0;
}

.app-notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--psk-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.app-notif-body {
  flex: 1;
  min-width: 0;
}

.app-notif-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--psk-dark);
  word-break: break-word;
}

.app-notif-time {
  font-size: 0.7rem;
  color: var(--psk-gray-text);
  margin-top: 2px;
}

.app-notif-dismiss-form { margin: 0; flex-shrink: 0; }

.app-notif-dismiss {
  background: none;
  border: none;
  color: var(--psk-gray-text);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
}
.app-notif-dismiss:hover {
  background: var(--psk-bg);
  color: var(--psk-dark);
}

.app-notif-more {
  padding: 10px 16px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--psk-gray-text);
  background: var(--psk-bg);
  border-top: 1px solid var(--psk-border);
}

button:disabled {
  cursor: not-allowed;
}

.btn-loading {
  opacity: 0.65;
  pointer-events: none;
  cursor: wait;
}

.btn-loading::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.55em;
  vertical-align: -0.15em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: psk-btn-spin 0.7s linear infinite;
}

@keyframes psk-btn-spin {
  to { transform: rotate(360deg); }
}

.disabled-link {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}
