/* === ADMIN STYLES === */
:root {
  --corten: #eb5e50;
  --corten-dark: #c44d40;
  --iron: #212122;
  --steel: #20314b;
  --green-oxide: #233c39;
  --off-white: #f5f4f2;
  --mid-gray: #e8e6e2;
  --gray-muted: #8a8a8a;
  --white: #fff;
  --corten-10: rgba(235,94,80,0.10);
  --iron-60: rgba(33,33,34,0.60);
  --iron-10: rgba(33,33,34,0.08);
  --green-light: #d4e4d6;
  --red-light: #fce4e0;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--iron);
  background: var(--off-white);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }

/* === TOPBAR === */
.admin-topbar {
  background: var(--iron);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 14px 0;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
}
.brand-name {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.brand-sub {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--corten);
  text-transform: uppercase;
  margin-top: 1px;
  font-weight: 600;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.user-info {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
}
.logout-btn {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s;
}
.logout-btn:hover { background: var(--corten); }

/* === PAGE HEADER === */
.page-header {
  background: var(--white);
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--mid-gray);
}
.page-header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-title {
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  line-height: 1.1;
}
.page-subtitle {
  color: var(--gray-muted);
  font-size: 14px;
}
.breadcrumb {
  font-size: 11px;
  color: var(--gray-muted);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.breadcrumb a {
  color: var(--gray-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--corten); }
.breadcrumb .sep { margin: 0 8px; opacity: 0.5; }
.breadcrumb .current { color: var(--iron); font-weight: 600; }

/* === MAIN === */
.main { padding: 36px 0 64px; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--corten);
  color: var(--white);
}
.btn-primary:hover { background: var(--corten-dark); }
.btn-secondary {
  background: var(--white);
  color: var(--iron);
  border: 1px solid var(--mid-gray);
}
.btn-secondary:hover { border-color: var(--iron); }
.btn-danger {
  background: var(--white);
  color: var(--corten);
  border: 1px solid var(--corten);
}
.btn-danger:hover { background: var(--corten); color: var(--white); }
.btn-small { padding: 7px 14px; font-size: 11px; }

/* === CARDS === */
.card {
  background: var(--white);
  border: 1px solid var(--mid-gray);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.card-title {
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title .count {
  font-size: 12px;
  font-weight: 600;
  color: var(--corten);
  background: var(--corten-10);
  padding: 2px 9px;
  border-radius: 12px;
  letter-spacing: 0;
}

/* === LIST === */
.list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--mid-gray);
}
.list-row:last-child { border-bottom: none; }
.list-row-info { flex: 1; min-width: 0; }
.list-row-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
  color: var(--iron);
}
.list-row-meta {
  font-size: 11px;
  color: var(--gray-muted);
  letter-spacing: 0.02em;
}
.list-row-meta span + span::before { content: '·'; margin: 0 6px; opacity: 0.5; }
.list-row-actions {
  display: flex;
  gap: 6px;
}

/* === DOC ICON === */
.doc-icon {
  flex-shrink: 0;
  width: 40px;
  height: 48px;
  background: var(--off-white);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--iron);
  position: relative;
}
.doc-icon::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: var(--mid-gray);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.doc-icon.pdf { background: #fce4e0; color: #c44d40; }
.doc-icon.xlsx { background: #e0f0e0; color: #1e7e34; }
.doc-icon.docx { background: #e0e8f5; color: #2854a0; }
.doc-icon.image { background: #f5e8d4; color: #c47010; }

/* === FORMS === */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray-muted);
  margin-bottom: 8px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--mid-gray);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  background: var(--white);
  transition: all 0.15s;
  color: var(--iron);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--corten);
  box-shadow: 0 0 0 3px var(--corten-10);
}
.form-textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.form-help {
  font-size: 11px;
  color: var(--gray-muted);
  margin-top: 6px;
}
.form-file {
  padding: 10px 14px;
  border: 2px dashed var(--mid-gray);
  border-radius: 6px;
  background: var(--off-white);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.form-file:hover {
  border-color: var(--corten);
  background: var(--corten-10);
}
.form-file input { display: none; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* === ALERTS === */
.alert {
  padding: 14px 18px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 20px;
  border-left: 3px solid;
}
.alert-success {
  background: var(--green-light);
  color: var(--green-oxide);
  border-color: var(--green-oxide);
}
.alert-error {
  background: var(--red-light);
  color: var(--corten);
  border-color: var(--corten);
}

/* === GRID === */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }

/* === CLIENT CARD === */
.client-card {
  background: var(--white);
  border: 1px solid var(--mid-gray);
  border-radius: 8px;
  padding: 20px;
  transition: all 0.2s;
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.client-card:hover {
  border-color: var(--corten);
  box-shadow: 0 4px 16px rgba(33,33,34,0.06);
  transform: translateY(-2px);
}
.client-card .client-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--corten);
  margin-bottom: 8px;
  display: block;
}
.client-card h3 {
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.client-card .client-meta {
  font-size: 11px;
  color: var(--gray-muted);
  margin-bottom: 12px;
}
.client-card .client-stats {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--mid-gray);
  font-size: 11px;
  color: var(--gray-muted);
}
.client-card .client-stats strong {
  color: var(--iron);
  font-size: 13px;
  font-weight: 700;
  display: block;
}

/* === EMPTY === */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-muted);
  background: var(--white);
  border: 2px dashed var(--mid-gray);
  border-radius: 8px;
}
.empty h3 { color: var(--iron); margin-bottom: 8px; font-size: 16px; }
.empty p { font-size: 13px; margin-bottom: 20px; }

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(33,33,34,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white);
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--mid-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-weight: 700;
  font-size: 18px;
}
.modal-close {
  background: var(--off-white);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--iron-60);
  transition: all 0.15s;
}
.modal-close:hover { background: var(--corten); color: var(--white); }
.modal-body { padding: 24px 28px; }
.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--mid-gray);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* === LOGIN === */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--iron);
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  right: -10%;
  top: -10%;
  width: 60%;
  height: 120%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 728.7 916.72'%3E%3Cpath fill='%23eb5e50' d='M626.39,0H122.81c-8.49,4.84-15.31,8.72-23.8,13.56L5.45,171.52c0,9.34,0,16.73,0,26.08l81.95,138.53h33.49l72.62-139.37c7.77-4.71,13.85-8.4,21.62-13.11h313.79c7.38-4.21,13.31-7.59,20.69-11.81l88.97-150.5c-5.43-9.51-6.75-11.83-12.18-21.34Z'/%3E%3Cpath fill='%23eb5e50' d='M233.54,550.18h279.41c7.86,4.48,14.17,8.08,22.03,12.56l86.2,144.31h23.84l83.68-141.68v-33.44l-90.25-151.45c-8.35-4.8-15.04-8.64-23.39-13.44H140.51l-18.03,28.18,82.15,138.21,28.91,16.75Z'/%3E%3Cpath fill='%23eb5e50' d='M113.95,733.58h488.45c5.85,10.27,7.27,12.76,13.12,23.02l-85.11,143.4-28.96,16.72H13.06c-5.82-10.21-7.24-12.69-13.06-22.91l84.99-143.52,28.96-16.72Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.06;
  pointer-events: none;
}
.login-box {
  background: var(--white);
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  padding: 40px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  position: relative;
  z-index: 1;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--mid-gray);
}
.login-logo-text {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--iron);
}
.login-logo-sub {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--corten);
  text-transform: uppercase;
  margin-top: 1px;
  font-weight: 600;
}
.login-title {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.login-subtitle {
  color: var(--gray-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

/* === STATS BOXES === */
.stat-box {
  background: var(--white);
  border: 1px solid var(--mid-gray);
  border-radius: 8px;
  padding: 22px;
}
.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-muted);
  margin-bottom: 8px;
}
.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--iron);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-value.corten { color: var(--corten); }
