@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-dark:  #00214D;
  --blue:       #003087;
  --blue-mid:   #0052CC;
  --blue-light: #EBF1FB;
  --green:      #00A651;
  --green-dark: #007A3D;
  --bg:         #F2F5FA;
  --white:      #FFFFFF;
  --border:     #D6DFEE;
  --text:       #1A2133;
  --muted:      #6B7A99;
  --danger:     #CC2936;
  --warning:    #E07B00;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 2px 16px rgba(0, 32, 87, 0.10);
  --shadow-lg:  0 8px 32px rgba(0, 32, 87, 0.14);
}

body {
  font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
}

/* ---- Layout ---- */
.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(150deg, #00214D 0%, #003087 50%, #0052CC 100%);
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 16px;
}

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
  width: 100%;
  max-width: 440px;
}

.card-wide {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 20px;
}

/* ---- Login logo ---- */
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0,48,135,0.3);
}

.login-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -0.3px;
}

.card h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 6px;
}

.card-wide h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

/* ---- Top bar ---- */
.topbar {
  background: linear-gradient(90deg, var(--blue-dark) 0%, var(--blue) 100%);
  color: var(--white);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,33,77,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  opacity: 0.92;
}

/* ---- Form ---- */
.form-group { margin-bottom: 18px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="date"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.12);
}

textarea { resize: vertical; min-height: 96px; }

.auto-field {
  padding: 11px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  font-family: inherit;
  letter-spacing: 0.01em;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  color: var(--white);
  width: 100%;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(0,48,135,0.25);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #002570 0%, #003FB5 100%);
  box-shadow: 0 6px 18px rgba(0,48,135,0.35);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.35);
  color: var(--white);
  font-size: 13px;
  padding: 8px 16px;
}
.btn-outline:hover:not(:disabled) { background: rgba(255,255,255,0.1); }

.btn-outline-dark {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline-dark:hover:not(:disabled) { background: var(--bg); }

.btn-success {
  background: linear-gradient(135deg, var(--green) 0%, #00C060 100%);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(0,166,81,0.25);
}
.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
}

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover:not(:disabled) { background: #A01E28; }

.btn-sm {
  padding: 5px 13px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: transparent;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s;
  color: var(--text);
}
.btn-sm:hover { background: var(--bg); }
.btn-sm.btn-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-sm.btn-danger:hover { background: #FEE8E9; }

/* ---- Messages ---- */
.error-msg {
  background: #FEF0F0;
  border: 1px solid #F5B8BB;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 14px;
  margin-top: 14px;
  font-weight: 500;
}

.success-msg {
  background: #EDFAF3;
  border: 1px solid #A3E4C1;
  color: var(--green-dark);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 14px;
  margin-top: 14px;
  font-weight: 500;
}

.hidden { display: none !important; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-success    { background: #DCFAEC; color: #007A3D; }
.badge-in_progress { background: #FFF4E0; color: #A05800; }
.badge-refused    { background: #FEE8E9; color: #A01E28; }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  transition: color 0.15s;
  letter-spacing: 0.01em;
}
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-btn:hover:not(.active) { color: var(--text); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; margin-top: 20px; border-radius: var(--radius-sm); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left;
  padding: 11px 16px;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  background: #F8FAFD;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #F5F8FF; }
.row-inactive td { opacity: 0.5; }
.loading-cell { text-align: center; color: var(--muted); padding: 32px; font-size: 14px; }
.actions-cell { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Form sections ---- */
.form-section {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.form-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: var(--blue);
  border-radius: 2px;
  flex-shrink: 0;
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.req { color: var(--danger); }

/* ---- City autocomplete ---- */
.autocomplete-wrapper { position: relative; }
.suggestions-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--blue-mid);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,32,87,0.14);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
}
.suggestion-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover,
.suggestion-item.active { background: var(--blue-light); color: var(--blue); font-weight: 500; }

/* ---- Period selector ---- */
.period-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.period-label-text { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.period-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.period-btn {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  transition: all 0.15s;
}
.period-btn:hover { border-color: var(--blue-mid); color: var(--blue); }
.period-btn.active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0,48,135,0.2);
}

/* ---- Stats cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: var(--shadow); }

.stat-card-success  { border-color: #A3E4C1; background: linear-gradient(135deg, #EDFAF3 0%, #F8FFFC 100%); }
.stat-card-progress { border-color: #FFD88A; background: linear-gradient(135deg, #FFF8E8 0%, #FFFDF5 100%); }
.stat-card-refused  { border-color: #F5B8BB; background: linear-gradient(135deg, #FEF0F0 0%, #FFF8F8 100%); }

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.stat-card-success  .stat-value { color: var(--green-dark); }
.stat-card-progress .stat-value { color: #A05800; }
.stat-card-refused  .stat-value { color: var(--danger); }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- Filter row ---- */
.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
/* Autocomplete wrapper внутри фильтров */
.fa-wrapper { position: relative; width: 100%; }
.fa-wrapper input { width: 100%; }

/* ---- Stats block (admin + my-meetings) ---- */
.stats-block {
  display: flex;
  gap: 14px;
  align-items: stretch;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.stats-total {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 18px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  box-shadow: 0 4px 14px rgba(0,33,77,0.25);
}
.stats-total span { display: block; font-size: 44px; font-weight: 700; line-height: 1; }
.stats-total small { display: block; font-size: 11px; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 8px; font-weight: 600; }

.stats-metrics {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 260px;
}

.stats-metric-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.metric-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 56px;
  flex-shrink: 0;
}

.metric-cell {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  border-radius: 8px;
}
.metric-cell span { display: block; font-size: 22px; font-weight: 700; line-height: 1; }
.metric-cell small { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; opacity: 0.65; }

.metric-plan span { color: var(--blue); }
.metric-plan small { color: var(--blue); }
.metric-fact { background: #EDFAF3; }
.metric-fact span { color: var(--green-dark); }
.metric-fact small { color: var(--green-dark); }
.metric-pct { background: #f5f3ff; }
.metric-pct span { color: #6d28d9; }
.metric-pct small { color: #6d28d9; }

@media (max-width: 500px) {
  .stats-total { width: 100%; flex-direction: row; justify-content: flex-start; gap: 16px; padding: 14px 18px; }
  .stats-total span { font-size: 36px; }
  .stats-metrics { min-width: 100%; }
  .metric-cell span { font-size: 18px; }
  .metric-label { min-width: 48px; font-size: 11px; }
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 33, 77, 0.55);
  backdrop-filter: blur(3px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body {
  overflow-y: auto;
  padding: 20px 28px 24px;
  flex: 1;
}

/* ---- Export row ---- */
.export-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.email-export { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; }

/* ---- Add employee form ---- */
.add-form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  margin-bottom: 24px;
}
.add-form-row .form-group { margin-bottom: 0; flex: 1; min-width: 180px; }

/* ---- Divider with title ---- */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--blue-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 18px;
  background: var(--blue);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), opacity 0.2s;
  z-index: 999;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast::before { font-size: 16px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: #003A1A; color: #fff; }
.toast-success::before { content: '✓'; }
.toast-error { background: #5C0A10; color: #fff; }
.toast-error::before { content: '✕'; }

/* ---- Responsive ---- */
@media (max-width: 700px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .form-row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .card { padding: 28px 20px; }
  .card-wide { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .topbar-title { font-size: 14px; }
  .container { padding: 16px 12px; }
  .export-row { flex-direction: column; align-items: stretch; }
  .email-export { flex-direction: column; }
}
