﻿:root {
  --ink: #0f3556;
  --ink-2: #15466f;
  --sky: #2f6e9f;
  --panel: #c6ced4;
  --paper: #e8edf1;
  --line: #9fb3c6;
  --white: #ffffff;
  --danger: #d12b2b;
  --warn: #c79200;
  --ok: #198f52;
  --violet: #6a48d7;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  background: var(--paper);
  color: #13334f;
}
a { color: inherit; text-decoration: none; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 86px 20px 20px;
}
.login-card {
  width: min(980px, 88vw);
  background: #f8fafc;
  border: 1px solid #c7d5e2;
  border-radius: 18px;
  padding: 28px 30px;
  box-shadow: 0 16px 34px rgba(15, 53, 86, 0.12);
}
.login-card h1 {
  margin: 0 0 2px;
  color: #083a67;
  font-size: 50px;
  letter-spacing: 0.4px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
input, select, textarea, button {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #b4c5d6;
  padding: 10px;
  font-size: 14px;
}
button {
  border: 1px solid #155184;
  background: #22689c;
  color: var(--white);
  cursor: pointer;
}
button.ghost {
  background: #eef4f9;
  color: #15466f;
  border-color: #9fb3c6;
}
.msg { margin-top: 8px; color: var(--danger); }
.ok { color: var(--ok); }

.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #123f66, #0c3456);
  color: #dbe9f7;
  border-right: 1px solid #113d61;
}
.sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}
.brand {
  font-size: 34px;
  line-height: 1;
  opacity: 0.9;
}
.brand-title {
  font-size: 34px;
  margin: 0;
  letter-spacing: 0.2px;
}
.nav-group { padding: 12px 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c8dcef;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 4px;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); }
.nav-item.active {
  background: rgba(0, 0, 0, 0.23);
  color: #fff;
}
.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 15px;
  opacity: 0.9;
}
.main-wrap { flex: 1; min-width: 0; }
.topbar {
  height: 64px;
  background: #bec7ce;
  border-bottom: 1px solid #98acbd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang-switch {
  display: flex;
  gap: 6px;
}
.login-card .lang-switch button {
  width: auto;
  min-width: 56px;
  height: 42px;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 24px;
}
.lang-switch button.active {
  background: #2b6da0;
  color: #fff;
  border-color: #155184;
}
.topbtn {
  width: auto;
  padding: 10px 18px;
  border-radius: 2px;
  background: #2b6da0;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #25567f;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2f6e9f;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: bold;
}
.content {
  padding: 22px 24px;
}
.panel {
  background: #e0e6eb;
  border: 1px solid #b2c1cf;
  padding: 12px;
  margin-bottom: 14px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.filter-btn {
  width: auto;
  background: #f8fbff;
  color: #1d4f77;
  border: 1px solid #6c93b0;
  border-radius: 2px;
  padding: 8px 14px;
}
.filter-btn.primary { background: #174c74; color: #fff; }
.filter-btn.warn { border-color: #d4ac3a; color: #9d7000; }
.filter-btn.danger { border-color: #e57a7a; color: #b12929; }

.table-wrap {
  border: 1px solid #a4b5c4;
  background: #d4dee6;
  overflow: auto;
}
table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}
thead th {
  background: #3270a0;
  color: #fff;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.3px;
  border-right: 1px solid #d0e0ef;
  padding: 10px;
}
tbody td {
  border-right: 1px solid #9fb3c4;
  border-top: 1px solid #a8bbc9;
  padding: 12px 10px;
  color: #114067;
  font-size: 14px;
}
tbody tr:nth-child(odd) { background: #dce3e9; }
tbody tr:nth-child(even) { background: #cddae4; }
.tag {
  font-weight: 700;
}
.tag.new { color: #e02323; }
.tag.replied { color: #0e37ff; }
.tag.waiting { color: #df7f00; }
.tag.progress { color: #6a48d7; }
.tag.hold { color: #e0148d; }
.prio {
  font-weight: 700;
}
.prio.critical { color: #d12929; }
.prio.high { color: #bf8d00; }
.prio.medium { color: #1a9f5f; }
.prio.low { color: #3a7ec8; }
.card {
  background: #e7edf2;
  border: 1px solid #b2c1cf;
  padding: 14px;
  margin-bottom: 14px;
}
.hidden { display: none; }
.inline-field {
  display: flex;
  gap: 8px;
  align-items: center;
}
.inline-field input {
  flex: 1;
}
.field-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field-stack label {
  color: #355d7e;
  font-size: 12px;
  font-weight: 700;
}
.tiny {
  width: auto;
  padding: 8px 10px;
}
.attachment-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.hint {
  font-size: 12px;
  color: #355d7e;
}
.attachment-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.att-item {
  border: 1px solid #9fb3c6;
  background: #f1f5f8;
  padding: 6px;
  border-radius: 8px;
}
.att-item img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  margin-bottom: 6px;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 23, 36, 0.45);
}
.modal-card {
  position: relative;
  width: min(860px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  overflow: auto;
  margin: 16px auto;
  background: #f4f8fb;
  border: 1px solid #9db1c3;
  border-radius: 10px;
  padding: 16px;
}
.detail-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #9fb3c6;
}

@media (max-width: 980px) {
  .login-wrap { padding-top: 32px; }
  .login-card {
    width: min(680px, 96vw);
    padding: 18px 16px;
    border-radius: 14px;
  }
  .login-card h1 {
    font-size: 35px;
  }
  .sidebar { width: 78px; }
  .brand-title, .nav-item span:last-child { display: none; }
  .topbar { padding: 0 12px; }
  .content { padding: 12px; }
  .topbtn { padding: 9px 12px; }
}
