.penalty-system {
  background: linear-gradient(145deg, rgba(255, 245, 236, 0.9), rgba(249, 236, 226, 0.95));
}

.policy-console {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #ebd8c8;
  border-radius: 22px;
  box-shadow: 0 20px 45px rgba(72, 36, 20, 0.12);
  padding: 1.5rem;
}

.policy-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.policy-tab {
  border: 1px solid #dbc0ab;
  background: #fff5ea;
  color: #5b2b16;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.policy-tab:hover {
  border-color: #c5754c;
  transform: translateY(-1px);
}

.policy-tab.active {
  background: #cf5d2d;
  border-color: #cf5d2d;
  color: #fff;
  box-shadow: 0 12px 22px rgba(207, 93, 45, 0.3);
}

.policy-status {
  background: #fff2e4;
  border: 1px solid #f0c8a8;
  color: #6c3519;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.policy-status.error {
  background: #ffe9e9;
  border-color: #f6b7b7;
  color: #a62b2b;
}

.policy-panel {
  display: none;
}

.policy-panel.active {
  display: block;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.policy-card {
  grid-column: span 4;
  background: #fffdf9;
  border: 1px solid #ecdac8;
  border-radius: 16px;
  padding: 1rem;
}

#client-panel .policy-card:first-child,
#partner-panel .policy-card:first-child {
  grid-column: span 6;
}

#admin-panel .policy-card {
  grid-column: span 3;
}

.policy-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
  color: #45200f;
}

.policy-card p {
  margin: 0 0 0.8rem;
  color: #684634;
  font-size: 0.92rem;
}

.policy-warning {
  background: #fff3e2;
  border: 1px solid #f3cc9a;
  color: #894714;
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-weight: 600;
}

.policy-form-row {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.policy-form-row label {
  font-size: 0.82rem;
  color: #5a3a2a;
  font-weight: 600;
}

.policy-form-row input,
.policy-form-row select,
.policy-form-row textarea {
  border: 1px solid #d8c0ad;
  border-radius: 10px;
  padding: 0.62rem 0.7rem;
  font-size: 0.9rem;
  background: #fff;
}

.policy-form-row textarea {
  resize: vertical;
  min-height: 82px;
}

.policy-checkbox {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.7rem;
  font-size: 0.86rem;
  color: #5b3b2c;
}

.policy-action-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin: 0.8rem 0;
}

.policy-btn {
  border: 1px solid #ba6a45;
  background: #d96f3e;
  color: #fff;
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.policy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 15px rgba(145, 68, 34, 0.18);
}

.policy-btn.ghost {
  background: #fff7ef;
  color: #8b4a2c;
}

.policy-btn.danger {
  background: #b34040;
  border-color: #9f2d2d;
}

.policy-output {
  margin-top: 0.55rem;
  background: #f7efe7;
  border: 1px solid #e4d0c0;
  border-radius: 10px;
  padding: 0.7rem;
  color: #4e362a;
  font-size: 0.84rem;
  line-height: 1.45;
  min-height: 64px;
  white-space: pre-wrap;
}

.policy-output.error {
  background: #ffe9e9;
  border-color: #efbbbb;
  color: #972b2b;
}

.policy-list {
  margin: 0;
  padding-left: 1.05rem;
  color: #5f3f2f;
  display: grid;
  gap: 0.45rem;
}

.policy-table-wrap {
  margin-top: 1rem;
  background: #fffefc;
  border: 1px solid #ecdccf;
  border-radius: 14px;
  padding: 0.9rem;
  overflow: hidden;
}

.policy-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.policy-table-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #4a2616;
}

.policy-inline-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.policy-inline-filters select,
.policy-inline-filters input {
  border: 1px solid #d6bca8;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-size: 0.84rem;
  min-width: 106px;
}

.policy-totals {
  font-size: 0.86rem;
  color: #5f3a28;
  margin-bottom: 0.55rem;
}

.policy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.policy-table th,
.policy-table td {
  border-bottom: 1px solid #efdfd2;
  text-align: left;
  padding: 0.5rem 0.42rem;
  vertical-align: top;
}

.policy-table th {
  background: #fdf1e3;
  color: #59311f;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.policy-empty {
  text-align: center;
  color: #7f6658;
}

.policy-row-actions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.policy-row-actions button {
  border: 1px solid #d7b8a1;
  background: #fff7ef;
  color: #6f4128;
  border-radius: 8px;
  padding: 0.28rem 0.45rem;
  font-size: 0.74rem;
  cursor: pointer;
}

.policy-row-actions button:hover {
  border-color: #ca855f;
}

@media (max-width: 1080px) {
  .policy-card,
  #client-panel .policy-card:first-child,
  #partner-panel .policy-card:first-child,
  #admin-panel .policy-card {
    grid-column: span 6;
  }
}

@media (max-width: 760px) {
  .policy-tabs {
    grid-template-columns: 1fr;
  }

  .policy-card,
  #client-panel .policy-card:first-child,
  #partner-panel .policy-card:first-child,
  #admin-panel .policy-card {
    grid-column: span 12;
  }

  .policy-table-wrap {
    overflow-x: auto;
  }

  .policy-table {
    min-width: 760px;
  }
}
