/* Base design system for HR app (RTL-first) */
@font-face{
  font-family:"Vazir";
  src:url("../font/Vazir.woff2") format("woff2"),
      url("../font/Vazir.woff") format("woff");
  font-weight:400;
  font-style:normal;
  font-display:swap;
}

@font-face{
  font-family:"Vazir";
  src:url("../font/Vazir-Light.woff2") format("woff2"),
      url("../font/Vazir-Light.woff") format("woff");
  font-weight:300;
  font-style:normal;
  font-display:swap;
}

@font-face{
  font-family:"Vazir";
  src:url("../font/Vazir-Medium.woff2") format("woff2"),
      url("../font/Vazir-Medium.woff") format("woff");
  font-weight:500;
  font-style:normal;
  font-display:swap;
}

@font-face{
  font-family:"Vazir";
  src:url("../font/Vazir-Bold.woff2") format("woff2"),
      url("../font/Vazir-Bold.woff") format("woff");
  font-weight:700;
  font-style:normal;
  font-display:swap;
}

:root{
  --bg0:#050a14;
  --bg1:#0b1220;
  --surface:rgba(15, 23, 42, .78);
  --surface-2:rgba(2, 6, 23, .65);
  --border:rgba(148, 163, 184, .18);
  --border-strong:rgba(148, 163, 184, .28);

  --text:#e5e7eb;
  --muted:#a7b0c0;
  --hint:#7b879b;

  --primary:#38bdf8;   /* cyan */
  --primary-2:#22c55e; /* green */
  --danger:#ef4444;
  --warn:#f59e0b;

  --radius-xl:18px;
  --radius-lg:14px;
  --radius-md:12px;

  --shadow-lg:0 26px 60px rgba(0,0,0,.65);
  --shadow-md:0 14px 35px rgba(0,0,0,.45);

  --container: 920px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: "Vazir", "Segoe UI", Tahoma, sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 500px at 70% -10%, rgba(56,189,248,.25), transparent 60%),
    radial-gradient(900px 500px at 20% 10%, rgba(34,197,94,.18), transparent 55%),
    radial-gradient(circle at top, var(--bg1), var(--bg0));
  direction: rtl;
}

.subtitle{margin:0 0 18px; text-align:center; color: var(--muted); line-height:1.8rem;}

/* =========================
   Custom Status Switch
========================= */

/* ===== Status Buttons (checkbox-backed) ===== */
.opinion-status-row{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  padding:14px;
  border-radius:14px;
  background:rgba(15,23,42,.45);
  border:1px solid rgba(148,163,184,.16);
}

.opinion-status-row h4{
  margin:0;
  color:rgba(229,231,235,.78);
  font-size:.92rem;
  font-weight:900;
}

.status-choice {
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  padding:0;
  border-radius:14px;
  background:transparent;
  border:0;
  box-shadow:none;
}

/* خود checkbox را مخفی می‌کنیم اما در فرم می‌ماند */
.status-choice #id_status {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.status-btn {
  position:relative;
  z-index:1;
  min-height:46px;
  min-width:126px;
  padding:11px 18px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.22);
  background:rgba(15,23,42,.72);
  color:rgba(226,232,240,.88);
  font-weight:900;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
  user-select:none;
  text-align:center;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06), 0 8px 18px rgba(0,0,0,.18);
}

.status-btn::before{
  content:none;
}

.status-btn:hover {
  color:#f8fafc;
  background:rgba(30,41,59,.88);
  border-color:rgba(148,163,184,.36);
  transform:translateY(-1px);
}

.status-btn:active {
  transform:scale(.98);
}

.status-btn.is-active {
  color:#fff;
  box-shadow:0 12px 26px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.18);
}

.status-btn.status-yes.is-active {
  background:#16a34a;
  border-color:#22c55e;
  color:#f0fdf4;
}

.status-btn.status-no.is-active {
  background:#dc2626;
  border-color:#ef4444;
  color:#fff1f2;
}

.status-btn:focus-visible {
  outline:2px solid rgba(56,189,248,.72);
  outline-offset:3px;
}

@media (max-width:520px){
  .status-choice{
    width:100%;
  }

  .status-btn{
    width:100%;
  }
}

/* ========================================== */


a{ color:inherit; }
img{ max-width:100%; height:auto; }

.page{
  min-height:100vh;
  padding: 44px 18px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.card{
  width: min(100%, var(--container));
  background: linear-gradient(180deg, rgba(15, 23, 42, .86), rgba(2, 6, 23, .72));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  padding: 28px;
}

.card-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom: 18px;
}

.card-title{
  margin:0;
  font-size: 1.35rem;
  line-height: 1.9rem;
  letter-spacing: -.2px;
}

.card-subtitle{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.6rem;
}


/* headings */
.card h2{ margin:0 0 18px; text-align:center; font-size:1.35rem; }

.form-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}
@media (max-width: 720px){
  
/* headings */
.card h2{ margin:0 0 18px; text-align:center; font-size:1.35rem; }

.form-grid{ grid-template-columns: 1fr; }
  .field.full{ grid-column:auto; }
}

.field{ display:flex; flex-direction:column; gap:8px; }
.field.full{ grid-column: span 2; }

label{
  font-size:.86rem;
  color: var(--muted);
}

input, select, textarea{
  width:100%;
  background: rgba(2, 6, 23, .45);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 12px;
  font-size: .95rem;
  color: var(--text);
  transition: transform .12s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
textarea{ resize: vertical; min-height: 90px; }

input::placeholder, textarea::placeholder{ color: rgba(167, 176, 192, .55); }

input:focus, select:focus, textarea:focus{
  outline:none;
  border-color: rgba(56,189,248,.8);
  box-shadow: 0 0 0 4px rgba(56,189,248,.16);
  background: rgba(2, 6, 23, .6);
}

.time24-input{
  direction:ltr;
  text-align:left;
  font-variant-numeric:tabular-nums;
}

.help{
  color: var(--hint);
  font-size:.78rem;
  line-height: 1.3rem;
}


.card > .btn,
.card > a.btn,
.card > button.btn{ margin-top: 16px; }

.actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top: 18px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  cursor:pointer;
  font-size: .95rem;
  text-decoration:none;
  user-select:none;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  background: rgba(15,23,42,.55);
  color: var(--text);
}
.btn:hover{ transform: translateY(-1px); border-color: rgba(56,189,248,.35); box-shadow: var(--shadow-md); }
.btn:active{ transform: translateY(0); }

.btn-primary{
  border-color: rgba(56,189,248,.45);
  background: linear-gradient(90deg, rgba(56,189,248,.95), rgba(34,197,94,.85));
  color: #06101a;
  font-weight: 700;
}
.btn-primary:hover{ border-color: rgba(56,189,248,.8); }

.btn.btn-back{
  position:relative;
  min-height:44px;
  padding:11px 16px 11px 18px;
  border-radius:14px;
  border:1px solid rgba(125,211,252,.42);
  background:
    linear-gradient(135deg, rgba(15,23,42,.94), rgba(30,64,175,.48)),
    radial-gradient(circle at 20% 20%, rgba(125,211,252,.24), transparent 38%);
  color:#dbeafe;
  font-weight:850;
  letter-spacing:0;
  box-shadow:0 12px 24px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.10);
}
.btn.btn-back:hover{
  border-color:rgba(147,197,253,.82);
  background:
    linear-gradient(135deg, rgba(30,64,175,.68), rgba(14,165,233,.30)),
    radial-gradient(circle at 20% 20%, rgba(191,219,254,.28), transparent 42%);
  color:#f8fbff;
  box-shadow:0 16px 34px rgba(0,0,0,.36), 0 0 0 4px rgba(96,165,250,.12);
}
.btn.btn-back:focus-visible{
  outline:2px solid rgba(125,211,252,.78);
  outline-offset:3px;
}

.btn-add{
  border-color:rgba(34,197,94,.42);
  background:rgba(22,163,74,.18);
  color:#bbf7d0;
  font-weight:800;
}
.btn-add:hover{
  border-color:rgba(74,222,128,.7);
  background:rgba(22,163,74,.28);
}

.btn-edit{
  position:relative;
  min-height:38px;
  padding:9px 15px 9px 17px;
  border-radius:12px;
  border:1px solid rgba(251,191,36,.72);
  background:
    linear-gradient(135deg, rgba(251,191,36,.95), rgba(56,189,248,.78));
  color:#07111f;
  font-size:.86rem;
  font-weight:900;
  box-shadow:0 12px 24px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.38);
}
.btn-edit::before{
  content:"";
  width:14px;
  height:14px;
  flex:0 0 14px;
  border-radius:2px;
  background:currentColor;
  clip-path:polygon(12% 74%, 0 100%, 26% 88%, 88% 26%, 74% 12%);
  opacity:.95;
}
.btn-edit:hover{
  border-color:rgba(254,240,138,.96);
  background:
    linear-gradient(135deg, rgba(254,240,138,.98), rgba(125,211,252,.88));
  color:#020617;
  box-shadow:0 16px 32px rgba(0,0,0,.38), 0 0 0 4px rgba(251,191,36,.14);
}
.btn-edit:focus-visible{
  outline:2px solid rgba(250,204,21,.78);
  outline-offset:3px;
}

.btn-ghost{
  background: transparent;
}

.hidden{ display:none !important; }

/* list / preview cards */
.list-card{
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(148,163,184,.28);
}
.item{
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 16px;
  padding: 14px;
  margin-top: 12px;
  background: rgba(2, 6, 23, .35);
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
.item:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,.35);
  border-color: rgba(56,189,248,.28);
}
.item-title{ font-weight: 800; color: rgba(56,189,248,.95); margin-bottom: 6px; }
.item-meta{ display:flex; flex-wrap:wrap; gap: 10px 14px; color: rgba(229,231,235,.85); font-size:.86rem; }

.item-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:10px;
}

.record-list-card{
  overflow:hidden;
}

.record-list-scroll{
  max-height:330px;
  overflow-y:auto;
  padding-left:18px;
  scrollbar-color:rgba(56,189,248,.7) rgba(15,23,42,.45);
  scrollbar-width:thin;
}

.ajax-search-form{
  position:relative;
}

.ajax-search-form.is-loading::after{
  content:"";
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:3px;
  background:linear-gradient(90deg, transparent, var(--primary), var(--primary-2), transparent);
  animation: ajax-search-loading 1s linear infinite;
}

.ajax-search-row th{
  padding:6px 8px 12px !important;
  background:rgba(2,6,23,.28);
  border-bottom:1px solid rgba(148,163,184,.14);
}

.ajax-search-row input{
  min-width:120px;
  padding:9px 10px;
  border-radius:10px;
  font-size:.82rem;
}

.appointment-row > td{
  transition: background-color .18s ease, border-color .18s ease;
}

.appointment-row--done > td{
  background: rgba(34, 197, 94, .14);
  border-top: 1px solid rgba(34, 197, 94, .24);
  color:#bbf7d0;
}

.appointment-row--pending > td{
  background: rgba(239, 68, 68, .11);
  border-top: 1px solid rgba(239, 68, 68, .20);
  color:#fecaca;
}

.interview-toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
  color:var(--text);
  cursor:pointer;
}

.interview-toggle input{
  width:18px;
  height:18px;
  accent-color: var(--primary-2);
}

@keyframes ajax-search-loading{
  from{ background-position:-220px 0; }
  to{ background-position:220px 0; }
}

/* print helpers (admin page later) */
@media print{
  body{ background:#fff !important; color:#000 !important; }
  .page{ padding:0 !important; }
  .card{ box-shadow:none !important; border:1px solid #ddd !important; background:#fff !important; }
  .btn, 
.card > .btn,
.card > a.btn,
.card > button.btn{ margin-top: 16px; }

.actions{ display:none !important; }
}

.user-badge{
  position:relative;
  display:grid;
  grid-template-columns:46px minmax(0, 1fr) auto;
  align-items:center;
  gap:13px;
  max-width:100%;
  min-width:300px;
  min-height:74px;
  padding:13px 15px;
  overflow:hidden;
  border-radius:16px;
  background:
    linear-gradient(135deg, rgba(56,189,248,.16), transparent 34%),
    linear-gradient(180deg, rgba(15,23,42,.96), rgba(2,6,23,.82));
  border:1px solid rgba(125,211,252,.28);
  color:rgba(255,255,255,.94);
  box-shadow:0 16px 36px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.08);
  transition:transform .16s ease, border-color .18s ease, box-shadow .18s ease;
}

.user-badge::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:4px;
  background:linear-gradient(180deg, var(--primary), var(--primary-2));
}

.user-badge::after{
  content:"";
  position:absolute;
  right:15px;
  bottom:10px;
  width:7px;
  height:7px;
  border-radius:999px;
  background:#22c55e;
  box-shadow:0 0 0 4px rgba(34,197,94,.12);
}

.user-badge:hover{
  transform:translateY(-1px);
  border-color:rgba(125,211,252,.48);
  box-shadow:0 20px 42px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.10);
}

.user-badge__icon{
  position:relative;
  width:46px;
  height:46px;
  border-radius:14px;
  background:
    radial-gradient(circle at 50% 33%, rgba(255,255,255,.96) 0 12%, transparent 13%),
    radial-gradient(circle at 50% 75%, rgba(255,255,255,.96) 0 23%, transparent 24%),
    linear-gradient(135deg, rgba(56,189,248,.95), rgba(34,197,94,.86));
  box-shadow:0 0 0 1px rgba(255,255,255,.16), 0 10px 20px rgba(0,0,0,.22);
}

.user-badge__icon::after{
  content:"";
  position:absolute;
  inset:5px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.18);
}

.user-badge__text{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
  line-height:1.2;
}

.user-badge__label{
  width:max-content;
  padding:3px 8px;
  border-radius:999px;
  background:rgba(56,189,248,.10);
  color:#bae6fd;
  border:1px solid rgba(56,189,248,.18);
  font-size:.72rem;
  font-weight:900;
}

.user-badge__name{
  max-width:230px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#f8fafc;
  font-size:1.02rem;
  font-weight:950;
}

.role-pill{
  justify-self:end;
  padding:8px 11px;
  border-radius:999px;
  font-size:12px;
  line-height:1;
  font-weight:950;
  background:linear-gradient(135deg, rgba(34,197,94,.22), rgba(56,189,248,.12));
  border:1px solid rgba(74,222,128,.36);
  color:#dcfce7;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08);
}

@media (max-width: 520px){
  .user-badge{
    grid-template-columns: 38px minmax(0, 1fr);
    width:100%;
    min-width:0;
  }

  .user-badge__name{
    max-width:none;
  }

  .role-pill{
    grid-column:2;
    justify-self:start;
  }
}

.readonly{
  padding:10px 12px;
  border-radius:10px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
}
