* { box-sizing: border-box; }
body { margin: 0; background: #f5f7fb; color: #1f2937; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.app-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #111827; color: #ffffff; display: flex; flex-direction: column; min-height: 100vh; padding: 24px; position: sticky; top: 0; }
.brand { color: #ffffff; font-size: 18px; font-weight: 700; margin-bottom: 32px; }
.brand:hover { text-decoration: none; }
.sidebar-nav { display: grid; gap: 8px; }
.sidebar-nav a { border-radius: 10px; color: #dbeafe; padding: 12px 14px; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: #1f2937; color: #ffffff; text-decoration: none; }
.sidebar-footer { border-top: 1px solid #374151; display: grid; gap: 12px; margin-top: auto; padding-top: 18px; }
.sidebar-footer span { color: #d1d5db; font-size: 13px; overflow-wrap: anywhere; }
.container { margin: 0 auto; max-width: 1180px; min-width: 0; padding: 32px; width: 100%; }
.auth-container { max-width: 520px; }
.page-header { align-items: center; display: flex; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { margin: 0 0 6px; }
.page-header p { color: #6b7280; margin: 0; }
.card { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06); padding: 24px; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid #e5e7eb; padding: 14px 12px; text-align: left; vertical-align: top; }
th { color: #6b7280; font-size: 13px; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
code { background: #eef2ff; border-radius: 6px; color: #3730a3; padding: 3px 6px; }
.actions, .button-group { align-items: center; display: flex; gap: 12px; }
.button { background: #ffffff; border: 1px solid #d1d5db; border-radius: 10px; color: #111827; cursor: pointer; display: inline-block; font: inherit; padding: 10px 14px; }
.button.primary { background: #2563eb; border-color: #2563eb; color: #ffffff; }
.button.danger { background: #dc2626; border-color: #dc2626; color: #ffffff; }
.button:hover { text-decoration: none; }
.link-button { background: none; border: 0; color: #dbeafe; cursor: pointer; font: inherit; padding: 0; }
.link-button.danger { color: #dc2626; }
.flash { border-radius: 10px; margin-bottom: 18px; padding: 14px 16px; }
.flash.notice { background: #ecfdf5; color: #065f46; }
.flash.alert { background: #fef2f2; color: #991b1b; }
.form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label, .checkbox { color: #374151; font-weight: 600; }
textarea, select, input[type="text"], input[type="number"], input[type="email"], input[type="password"] { border: 1px solid #d1d5db; border-radius: 10px; font: inherit; padding: 10px 12px; width: 100%; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checkbox { align-items: center; display: flex; gap: 8px; margin-top: 28px; }
.details dl { display: grid; gap: 14px; grid-template-columns: 220px 1fr; margin: 0; }
.details dt { color: #6b7280; font-weight: 700; }
.details dd { margin: 0; }
.empty-state { align-items: center; background: #ffffff; border: 1px dashed #cbd5e1; border-radius: 18px; color: #475569; display: flex; flex-direction: column; justify-content: center; min-height: 360px; padding: 48px; text-align: center; }
.empty-state-icon { align-items: center; background: #2563eb; border-radius: 18px; color: #ffffff; display: flex; font-weight: 800; height: 72px; justify-content: center; letter-spacing: 1px; margin-bottom: 22px; width: 72px; }
.empty-state h2 { color: #1f2937; margin: 0 0 8px; }
.empty-state p { margin: 0; max-width: 480px; }
.ideas-stats { display: grid; gap: 14px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 22px; }
.idea-stat-card { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 14px; color: #1f2937; display: grid; gap: 8px; padding: 16px 18px; }
.idea-stat-card:hover, .idea-stat-card.active { border-color: #2563eb; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12); text-decoration: none; }
.idea-stat-card strong { font-size: 25px; }
.idea-stat-label { color: #6b7280; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.ideas-panel { padding: 22px; }
.ideas-filters { align-items: end; display: grid; gap: 16px; grid-template-columns: minmax(240px, 1fr) 220px auto; }
.ideas-filter-actions { display: flex; gap: 10px; }
.ideas-list-heading { align-items: end; border-top: 1px solid #e5e7eb; display: flex; justify-content: space-between; margin-top: 24px; padding-top: 22px; }
.ideas-list-heading h2 { margin: 0 0 5px; }
.ideas-list-heading p { color: #6b7280; margin: 0; }
.table-wrap { overflow-x: auto; }
.ideas-table { table-layout: fixed; }
.ideas-table th { white-space: nowrap; }
.ideas-table th:nth-child(1) { width: 40%; }
.ideas-table th:nth-child(2) { width: 27%; }
.ideas-table th:nth-child(3) { width: 9%; }
.ideas-table th:nth-child(4) { width: 24%; }
.ideas-table td { vertical-align: top; overflow-wrap: anywhere; }
.idea-description { min-width: 0; }
.idea-description strong, .cell-primary { display: block; }
.idea-description strong { font-size: 14px; font-weight: 600; line-height: 1.6; }
.idea-meta { color: #64748b; display: flex; flex-wrap: wrap; font-size: 12px; gap: 4px 12px; margin-bottom: 8px; }
.idea-author .cell-primary { font-size: 14px; font-weight: 600; line-height: 1.5; }
.idea-author-email { color: #64748b; display: block; font-size: 13px; line-height: 1.5; margin-top: 5px; }
.ideas-table .idea-tags { margin-top: 12px; max-width: none; }
.ideas-table .idea-tag { line-height: 1.5; white-space: normal; }
.ideas-table .status-form { display: grid; gap: 10px; }
.ideas-table .status-form select { background: #fff; color: #1f2937; font-size: 13px; min-width: 0; padding: 9px 10px; }
.idea-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.idea-actions .button { min-height: 36px; text-align: center; }
.idea-delete-link { background: transparent; border-color: transparent; color: #b91c1c; }
.idea-delete-link:hover { background: #fef2f2; border-color: #fecaca; }
.ideas-panel :is(a, button, input, select):focus-visible, .idea-delete-layout :is(a, button):focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.ideas-table .vote-count { font-variant-numeric: tabular-nums; }
.idea-delete-layout { margin: 0 auto; max-width: 760px; }
.idea-delete-layout .page-header h1 { font-size: 26px; overflow-wrap: anywhere; }
.idea-delete-layout .page-header p { line-height: 1.5; }
.idea-delete-layout .details dl { gap: 12px 20px; grid-template-columns: 130px minmax(0, 1fr); }
.idea-delete-layout .details dd { line-height: 1.6; overflow-wrap: anywhere; }
.idea-delete-layout .flash { font-size: 14px; line-height: 1.6; }
.idea-delete-actions { border-top: 1px solid #e5e7eb; display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; margin-top: 24px; padding-top: 20px; }
.idea-delete-actions form { margin: 0; }
.muted { color: #94a3b8; display: block; font-size: 12px; margin-top: 5px; }
.idea-tags { display: flex; flex-wrap: wrap; gap: 6px; max-width: 190px; }
.idea-tag { background: #eff6ff; border-radius: 999px; color: #1d4ed8; font-size: 12px; padding: 5px 8px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.vote-count { align-items: center; background: #f8fafc; border-radius: 999px; color: #475569; display: inline-flex; font-weight: 700; justify-content: center; min-width: 32px; padding: 5px 9px; }
.status-badge { border-radius: 999px; display: inline-block; font-size: 12px; font-weight: 700; margin-bottom: 10px; padding: 6px 9px; white-space: nowrap; }
.status-registered { background: #fef3c7; color: #92400e; }
.status-planned { background: #ede9fe; color: #5b21b6; }
.status-in_development { background: #dbeafe; color: #1e40af; }
.status-completed { background: #dcfce7; color: #166534; }
.status-backed_up { background: #fef3c7; color: #92400e; }
.status-officially_synchronized { background: #dcfce7; color: #166534; }
.status-active, .status-confirmed { background: #dcfce7; color: #166534; }
.status-inactive, .status-pending { background: #fef3c7; color: #92400e; }
.status-form { align-items: center; display: flex; gap: 8px; }
.status-form select { min-width: 170px; }
.button-small { font-size: 13px; padding: 8px 10px; }
.empty-state.compact { min-height: 240px; }
.empty-state.compact .empty-state-icon { font-size: 24px; height: 56px; margin-bottom: 16px; width: 56px; }
.offline-receipts-table { min-width: 1120px; }
.offline-receipts-table th { white-space: nowrap; }
.offline-receipts-table td { vertical-align: middle; }
.pagination { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.payload-card { margin-top: 22px; }
.payload-card h2 { margin-top: 0; }
.payload-card pre { background: #0f172a; border-radius: 10px; color: #e2e8f0; max-height: 620px; overflow: auto; padding: 18px; white-space: pre-wrap; word-break: break-word; }
.users-panel { padding: 22px; }
.users-filters { align-items: end; display: grid; gap: 16px; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) 150px 170px auto; }
.users-filter-actions { display: flex; gap: 10px; }
.users-table { min-width: 1040px; }
.users-table th { white-space: nowrap; }
.users-table td { vertical-align: middle; }
.user-account { background: #eff6ff; border-radius: 999px; color: #1d4ed8; display: block; font-size: 12px; margin-bottom: 5px; padding: 5px 8px; width: fit-content; }
.user-details-grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); }
.user-details-grid h2, .user-accounts-card h2 { margin-top: 0; }
.user-actions { border-top: 1px solid #e5e7eb; margin-top: 24px; padding-top: 22px; }
.form-help { color: #6b7280; line-height: 1.5; }
.form-divider { border-top: 1px solid #e5e7eb; color: #6b7280; margin: 22px 0; padding-top: 18px; text-align: center; }
.user-accounts-card { margin-top: 22px; }
.billing-stats { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; }
.billing-stats .idea-stat-card strong { font-size: 21px; overflow-wrap: anywhere; }
.billing-nav { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.billing-card { margin-bottom: 22px; }
.billing-card h2 { margin-top: 0; }
.billing-card h3 { margin-top: 24px; }
.billing-title-row { align-items: flex-start; display: flex; justify-content: space-between; }
.billing-title-row h2 { margin-bottom: 8px; }
.billing-actions { align-items: end; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.billing-inline-form { align-items: end; border-top: 1px solid #e5e7eb; display: grid; gap: 12px; grid-template-columns: minmax(240px, 1fr) auto; margin-top: 24px; padding-top: 20px; }
.billing-filters { align-items: end; display: grid; gap: 16px; grid-template-columns: minmax(260px, 1fr) minmax(220px, .7fr) auto; margin-bottom: 24px; }
.billing-filters-wide { grid-template-columns: minmax(240px, 1fr) 190px 210px auto; }
.billing-filters-accounts { grid-template-columns: minmax(220px, 1fr) minmax(180px, .8fr) 150px minmax(180px, .8fr) auto; }
.billing-two-columns { display: grid; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.billing-wide-table { min-width: 1080px; }
.billing-status-sponsored, .billing-status-current, .billing-status-paid, .billing-status-issued, .billing-status-synced, .billing-status-published { background: #dcfce7; color: #166534; }
.billing-status-overdue, .billing-status-failed, .billing-status-reconciliation_required, .billing-status-disputed { background: #fee2e2; color: #991b1b; }
.billing-status-pending, .billing-status-awaiting, .billing-status-draft, .billing-status-issuing, .billing-status-ready { background: #fef3c7; color: #92400e; }
.billing-status-cancelled, .billing-status-refunded { background: #e5e7eb; color: #374151; }
textarea { border: 1px solid #d1d5db; border-radius: 10px; font: inherit; padding: 10px 12px; width: 100%; }
@media (max-width: 900px) { .app-shell { grid-template-columns: 1fr; } .sidebar { min-height: auto; position: static; } .sidebar-footer { margin-top: 24px; } }
@media (max-width: 900px) { .ideas-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ideas-filters { grid-template-columns: 1fr 1fr; } .ideas-filter-actions { grid-column: 1 / -1; } }
@media (max-width: 760px) { .page-header, .actions { align-items: flex-start; flex-direction: column; } .grid, .details dl, .ideas-filters { grid-template-columns: 1fr; } .ideas-filter-actions { grid-column: auto; } }
@media (max-width: 1100px) { .users-filters { grid-template-columns: 1fr 1fr; } .users-filter-actions { grid-column: 1 / -1; } }
@media (max-width: 760px) { .user-details-grid, .users-filters { grid-template-columns: 1fr; } .users-filter-actions { grid-column: auto; } }
@media (max-width: 1000px) { .billing-stats, .billing-two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } .billing-filters, .billing-filters-wide, .billing-filters-accounts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .billing-stats, .billing-two-columns, .billing-filters, .billing-filters-wide, .billing-filters-accounts, .billing-inline-form { grid-template-columns: 1fr; } }
@media (max-width: 1100px) {
  .ideas-table, .ideas-table tbody { display: block; }
  .ideas-table thead { clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
  .ideas-table tbody tr { border-bottom: 1px solid #e5e7eb; display: grid; gap: 16px 24px; grid-template-columns: minmax(0, 1fr) 200px; padding: 22px 0; }
  .ideas-table tbody tr:last-child { border-bottom: 0; padding-bottom: 0; }
  .ideas-table td { border: 0; min-width: 0; padding: 0; }
  .idea-description, .idea-author, .idea-votes { grid-column: 1; }
  .idea-management { grid-column: 2; grid-row: 1 / span 3; }
  .ideas-table td[data-label]::before { color: #64748b; content: attr(data-label); display: block; font-size: 12px; font-weight: 600; margin-bottom: 7px; }
  .idea-votes { align-items: center; display: flex; gap: 8px; }
  .ideas-table .idea-votes::before { margin-bottom: 0; }
}
@media (max-width: 760px) {
  .ideas-panel { padding: 18px; }
  .ideas-panel .field { min-width: 0; }
  .ideas-filter-actions { flex-wrap: wrap; }
  .ideas-table tbody tr { grid-template-columns: minmax(0, 1fr); }
  .ideas-table .idea-management { border-top: 1px solid #f1f5f9; grid-column: 1; grid-row: auto; padding-top: 16px; }
  .idea-actions .button { min-height: 44px; }
  .ideas-table .status-form select { font-size: 16px; min-height: 44px; }
  .idea-delete-layout .details dl { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .idea-delete-layout .details dt:not(:first-child) { margin-top: 12px; }
  .idea-delete-actions { flex-direction: column-reverse; }
  .idea-delete-actions .button { min-height: 44px; text-align: center; width: 100%; }
}
