:root {
  --pcrm-black: #0f0f10;
  --pcrm-black-soft: #17171a;
  --pcrm-white: #f7f5ef;
  --pcrm-red: #ba1f2d;
  --pcrm-red-soft: #8f1823;
  --pcrm-gold: #c8a24a;
  --pcrm-gold-soft: #f0d99f;
  --pcrm-border: rgba(247, 245, 239, 0.12);
  --pcrm-text: #f5f5f2;
  --pcrm-text-muted: rgba(247, 245, 239, 0.68);
  --pcrm-surface: linear-gradient(145deg, #131316 0%, #1b1b1f 60%, #111113 100%);
  --pcrm-surface-soft: #1e1e22;
  --pcrm-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --pcrm-radius: 18px;
  --pcrm-radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.pcrm-body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(200, 162, 74, 0.15) 0%, transparent 42%),
    radial-gradient(circle at 88% 88%, rgba(186, 31, 45, 0.18) 0%, transparent 45%),
    var(--pcrm-black);
  color: var(--pcrm-text);
  min-height: 100vh;
}

a {
  color: var(--pcrm-gold-soft);
}

p {
  line-height: 1.55;
}

.pcrm-kicker {
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--pcrm-gold);
  margin: 0 0 10px;
}

.pcrm-muted {
  color: var(--pcrm-text-muted);
  margin-top: 0;
}

.pcrm-alert {
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 0.95rem;
}

.pcrm-alert-success {
  border: 1px solid rgba(70, 178, 102, 0.45);
  background: rgba(32, 121, 61, 0.24);
}

.pcrm-alert-error {
  border: 1px solid rgba(186, 31, 45, 0.45);
  background: rgba(186, 31, 45, 0.22);
}

.pcrm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  padding: 11px 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.pcrm-btn:hover {
  transform: translateY(-1px);
}

.pcrm-btn-primary {
  background: linear-gradient(135deg, var(--pcrm-red) 0%, #cf3d4b 100%);
  color: #fff;
  box-shadow: 0 12px 30px rgba(186, 31, 45, 0.32);
}

.pcrm-btn-primary:hover {
  background: linear-gradient(135deg, var(--pcrm-red-soft) 0%, #c83342 100%);
}

.pcrm-btn-outline {
  color: var(--pcrm-gold-soft);
  border-color: rgba(200, 162, 74, 0.5);
  background: rgba(200, 162, 74, 0.08);
}

.pcrm-btn-block {
  width: 100%;
}

.pcrm-form {
  display: grid;
  gap: 12px;
}

.pcrm-form label {
  display: grid;
  gap: 6px;
}

.pcrm-form label > span {
  font-size: 0.84rem;
  color: var(--pcrm-gold-soft);
}

.pcrm-form input,
.pcrm-form select,
.pcrm-form textarea {
  width: 100%;
  border: 1px solid var(--pcrm-border);
  background: rgba(11, 11, 13, 0.55);
  color: var(--pcrm-text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.pcrm-form textarea {
  resize: vertical;
}

.pcrm-form input:focus,
.pcrm-form select:focus,
.pcrm-form textarea:focus {
  outline: none;
  border-color: var(--pcrm-gold);
  box-shadow: 0 0 0 3px rgba(200, 162, 74, 0.18);
}

.pcrm-login-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.pcrm-login-card {
  width: min(520px, 100%);
  padding: 36px 30px;
  background: linear-gradient(145deg, rgba(7, 7, 8, 0.95), rgba(18, 18, 20, 0.92));
  border: 1px solid rgba(200, 162, 74, 0.22);
  border-radius: 18px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pcrm-login-card h1 {
  margin: 0 0 16px;
  font-size: 2rem;
}

.pcrm-remember {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.pcrm-remember input {
  width: auto;
}

.pcrm-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr;
}

.pcrm-sidebar {
  background: rgba(8, 8, 9, 0.92);
  border-right: 1px solid rgba(200, 162, 74, 0.2);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.pcrm-brand {
  margin: 0 0 16px;
}

.pcrm-user-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--pcrm-radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.pcrm-user-card img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(200, 162, 74, 0.5);
}

.pcrm-user-card strong {
  display: block;
}

.pcrm-user-card span {
  display: block;
  font-size: 0.8rem;
  color: var(--pcrm-text-muted);
}

.pcrm-nav {
  display: grid;
  gap: 6px;
}

.pcrm-nav a {
  display: block;
  text-decoration: none;
  color: var(--pcrm-text-muted);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.pcrm-nav a:hover,
.pcrm-nav a.is-active {
  color: var(--pcrm-white);
  border-color: rgba(200, 162, 74, 0.55);
  background: linear-gradient(135deg, rgba(200, 162, 74, 0.12), rgba(186, 31, 45, 0.12));
}

.pcrm-main {
  padding: 26px;
  background: transparent !important;
}

.pcrm-app-mode main,
.pcrm-app-mode header {
  background: transparent;
}

.pcrm-main-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(200, 162, 74, 0.25);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 15, 16, 0.92), rgba(24, 24, 28, 0.78)) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
}

.pcrm-main-header > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pcrm-main-header h1 {
  margin: 0;
  line-height: 1.1;
  color: var(--pcrm-gold-soft);
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
}

.pcrm-main-header p {
  margin: 0;
  color: var(--pcrm-text-muted);
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(200, 162, 74, 0.35);
  background: rgba(200, 162, 74, 0.1);
}

.pcrm-menu-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid var(--pcrm-border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px;
  cursor: pointer;
}

.pcrm-menu-toggle span {
  display: block;
  height: 2px;
  background: var(--pcrm-gold);
}

.pcrm-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.pcrm-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pcrm-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pcrm-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pcrm-card {
  background: var(--pcrm-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--pcrm-radius);
  padding: 16px;
  box-shadow: var(--pcrm-shadow);
}

.pcrm-card h3 {
  margin: 0 0 12px;
}

.pcrm-card,
.pcrm-table-wrap,
.pcrm-note-box {
  min-width: 0;
}

.pcrm-metric h3 {
  margin-bottom: 8px;
  color: var(--pcrm-text-muted);
  font-size: 0.92rem;
}

.pcrm-metric strong {
  font-size: 1.5rem;
  color: var(--pcrm-gold-soft);
}

.pcrm-table-wrap {
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.pcrm-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}

.pcrm-table th,
.pcrm-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

.pcrm-table th {
  color: var(--pcrm-gold-soft);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pcrm-table-note {
  margin: 4px 0 0;
  color: var(--pcrm-text-muted);
  font-size: 0.85rem;
}

.pcrm-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.pcrm-status-planned,
.pcrm-status-new,
.pcrm-status-open,
.pcrm-status-pending {
  color: #d6d8df;
  background: rgba(159, 165, 187, 0.2);
  border-color: rgba(159, 165, 187, 0.45);
}

.pcrm-status-active,
.pcrm-status-in_progress,
.pcrm-status-review,
.pcrm-status-approved {
  color: #ffe4a8;
  background: rgba(200, 162, 74, 0.17);
  border-color: rgba(200, 162, 74, 0.44);
}

.pcrm-status-done,
.pcrm-status-closed {
  color: #a2f6b8;
  background: rgba(62, 158, 90, 0.2);
  border-color: rgba(62, 158, 90, 0.45);
}

.pcrm-status-hold,
.pcrm-status-cancelled,
.pcrm-status-rejected {
  color: #ffc6cd;
  background: rgba(186, 31, 45, 0.18);
  border-color: rgba(186, 31, 45, 0.43);
}

.pcrm-progress-list {
  display: grid;
  gap: 12px;
}

.pcrm-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.pcrm-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(247, 245, 239, 0.08);
  overflow: hidden;
}

.pcrm-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pcrm-red), var(--pcrm-gold));
  transition: width 0.8s ease;
}

.pcrm-balance {
  margin-top: 14px;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
}

.pcrm-balance.is-positive {
  border: 1px solid rgba(62, 158, 90, 0.5);
  color: #a8f6bc;
  background: rgba(62, 158, 90, 0.16);
}

.pcrm-balance.is-negative {
  border: 1px solid rgba(186, 31, 45, 0.55);
  color: #ffc6cd;
  background: rgba(186, 31, 45, 0.16);
}

.pcrm-bar-list {
  display: grid;
  gap: 10px;
}

.pcrm-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.pcrm-bar-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pcrm-bar-head strong {
  white-space: nowrap;
}

.pcrm-iframe-wrap {
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pcrm-iframe-wrap iframe {
  width: 100%;
  height: 360px;
  border: 0;
  background: #fff;
}

.pcrm-note-box {
  margin-top: 12px;
  border-left: 3px solid var(--pcrm-gold);
  padding: 10px 12px;
  background: rgba(200, 162, 74, 0.07);
  color: var(--pcrm-text-muted);
  overflow-wrap: anywhere;
}

.pcrm-filter-bar {
  margin-bottom: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.pcrm-filter-bar .pcrm-btn {
  width: max-content;
  min-width: 132px;
  align-self: end;
}

.pcrm-expense-total {
  margin-top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.pcrm-expense-total strong {
  color: var(--pcrm-gold-soft);
  font-size: 1.05rem;
}

.pcrm-inline-status {
  display: inline-flex;
  align-items: center;
  width: 100%;
  max-width: 210px;
}

.pcrm-inline-status .pcrm-auto-submit-status {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  border-radius: 999px;
  padding: 7px 34px 7px 12px;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid rgba(131, 139, 167, 0.45);
  color: #d5d8e4;
  background-color: rgba(131, 139, 167, 0.16);
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.pcrm-inline-status .pcrm-auto-submit-status.is-status-open,
.pcrm-inline-status .pcrm-auto-submit-status.is-status-pending {
  border-color: rgba(131, 139, 167, 0.45);
  color: #d5d8e4;
  background-color: rgba(131, 139, 167, 0.16);
}

.pcrm-inline-status .pcrm-auto-submit-status.is-status-review,
.pcrm-inline-status .pcrm-auto-submit-status.is-status-rejected {
  border-color: rgba(186, 31, 45, 0.5);
  color: #ffc8ce;
  background-color: rgba(186, 31, 45, 0.18);
}

.pcrm-inline-status .pcrm-auto-submit-status.is-status-approved,
.pcrm-inline-status .pcrm-auto-submit-status.is-status-closed {
  border-color: rgba(62, 158, 90, 0.5);
  color: #a8f6bc;
  background-color: rgba(62, 158, 90, 0.18);
}

.pcrm-profile-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.pcrm-profile-preview img {
  width: 70px;
  height: 70px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(200, 162, 74, 0.4);
}

.pcrm-profile-preview strong {
  display: block;
}

.pcrm-profile-preview span {
  color: var(--pcrm-text-muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.pcrm-plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.pcrm-plain-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  padding-bottom: 6px;
}

.pcrm-plain-list span {
  color: var(--pcrm-text-muted);
}

@media (max-width: 1200px) {
  .pcrm-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pcrm-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .pcrm-table {
    min-width: 560px;
  }

  .pcrm-layout {
    grid-template-columns: 1fr;
  }

  .pcrm-sidebar {
    position: fixed;
    left: -320px;
    z-index: 110;
    width: 300px;
    transition: left 0.25s ease;
  }

  .pcrm-sidebar.is-open {
    left: 0;
  }

  .pcrm-menu-toggle {
    display: inline-flex;
  }

  .pcrm-main {
    padding: 18px;
  }

  .pcrm-main-header {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 14px;
  }

  .pcrm-main-header p {
    font-size: 0.82rem;
  }

  .pcrm-grid-2,
  .pcrm-grid-3,
  .pcrm-grid-4 {
    grid-template-columns: 1fr;
  }

  .pcrm-filter-bar {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .pcrm-filter-bar .pcrm-btn {
    width: 100%;
    min-width: 0;
  }

  .pcrm-iframe-wrap iframe {
    height: 300px;
  }

  .pcrm-expense-total {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .pcrm-profile-preview > div {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .pcrm-main {
    padding: 12px;
  }

  .pcrm-main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .pcrm-main-header > div {
    width: 100%;
    min-width: 0;
  }

  .pcrm-main-header p {
    width: 100%;
    max-width: 100%;
    padding: 6px 10px;
  }

  .pcrm-card {
    padding: 12px;
    border-radius: 14px;
  }

  .pcrm-metric strong {
    font-size: 1.28rem;
    line-height: 1.15;
  }

  .pcrm-bar-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .pcrm-iframe-wrap iframe {
    height: 240px;
  }

  .pcrm-table-wrap {
    overflow: visible;
  }

  .pcrm-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .pcrm-table thead {
    display: none;
  }

  .pcrm-table tbody {
    display: block;
  }

  .pcrm-table tr {
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(12, 12, 14, 0.6);
    overflow: hidden;
  }

  .pcrm-table td {
    display: grid;
    grid-template-columns: minmax(88px, 108px) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 12px;
    min-height: 44px;
    word-break: break-word;
  }

  .pcrm-table td:last-child {
    border-bottom: 0;
  }

  .pcrm-table td::before {
    content: attr(data-label);
    color: var(--pcrm-gold-soft);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
  }

  .pcrm-table td[colspan] {
    display: block;
    padding: 12px;
  }

  .pcrm-table td[colspan]::before {
    content: none;
  }

  .pcrm-table td strong,
  .pcrm-table td p,
  .pcrm-table td span,
  .pcrm-table td form {
    min-width: 0;
  }

  .pcrm-inline-status .pcrm-auto-submit-status {
    width: 100%;
    min-width: 0;
  }

  .pcrm-login-layout {
    padding: 16px;
  }

  .pcrm-login-card {
    padding: 28px 20px;
  }

  .pcrm-login-card h1 {
    font-size: 1.6rem;
  }

  .pcrm-filter-bar {
    grid-template-columns: 1fr;
  }

  .pcrm-note-box,
  .pcrm-expense-total {
    padding: 10px;
  }

  .pcrm-expense-total {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .pcrm-inline-status {
    flex-direction: column;
    align-items: stretch;
  }

  .pcrm-inline-status .pcrm-auto-submit-status,
  .pcrm-filter-bar .pcrm-btn {
    width: 100%;
  }

  .pcrm-profile-preview {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .pcrm-profile-preview img {
    width: 64px;
    height: 64px;
  }

  .pcrm-plain-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
