@font-face {
    font-family: 'Vazirmatn';
    src: url('../assets/fonts/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

:root {
    /* Brand Colors */
    --color-navy: #1e3a8a;
    --color-navy-dark: #162c66;
    --color-navy-10: rgba(31, 59, 131, 0.10);
    --color-navy-20: rgba(31, 59, 131, 0.20);
    --color-gold: #b8960c;
    --color-gold-dark: #8a7520;
    --color-gold-10: rgba(177, 154, 51, 0.10);

    /* UI Colors */
    --color-bg: #ffffff;
    --color-surface: #f3f5fa;
    --color-border: #dde3f0;
    --color-text: #16192e;
    --color-muted: #64748b;
    --color-success: #16a34a;
    --color-danger: #e05454;

    /* Typography */
    --font: 'Vazirmatn', sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 999px;
}

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

* {
    /* Disabling text selection globally */
    -webkit-user-select: none;
    user-select: none;
}

/* Enable only on profile content */
.profile-section .info-value {
    -webkit-user-select: text;
    user-select: text;
}

/* Base */
body {
    font-family: var(--font);
    background-color: var(--color-bg);
    color: var(--color-text);
    direction: rtl;
    min-height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    overflow-x: hidden;
    font-size: 16px;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Typography */
.text-muted { color: var(--color-muted); }
.text-navy  { color: var(--color-navy); }
.text-gold  { color: var(--color-gold); }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 10px; }
.text-bold  { font-weight: 500; }

/* Layout */
.flex       { display: flex; align-items: center; }
.flex-col   { display: flex; flex-direction: column; }
.flex-1     { flex: 1; }
.gap-sm     { gap: var(--space-sm); }
.gap-md     { gap: var(--space-md); }

/* Spacing */
.p-md       { padding: var(--space-md); }
.px-md      { padding-inline: var(--space-md); }
.py-sm      { padding-block: var(--space-sm); }

/* Surfaces */
.card {
    background: var(--color-bg);
    border: 0.5px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.surface {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* ---------------------------- Bottom Navigation --------------------------- */

.bottom-nav {
    display: flex;
    height: 60px;
    border-top: 0.5px solid var(--color-border);
    background: var(--color-bg);
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(60px + env(safe-area-inset-bottom));
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--color-muted);
    transition: color 0.15s;
}

.nav-item.active {
    color: var(--color-navy);
}

.nav-icon {
    font-size: 20px;
}
.nav-label {
    font-size: 9px;
}

/* ------------------------------- Components ------------------------------- */

.person-card {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-bg);
    border: 0.5px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: border-color 0.15s;
}

.person-card:hover {
    border-color: var(--color-navy-20);
}

.person-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}

.person-info {
    flex: 1;
    min-width: 0;
}

.person-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.person-role {
    font-size: 13px;
    color: var(--color-muted);
    margin-top: 2px;
}

.person-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.badge-dept {
    background: var(--color-surface);
    color: var(--color-navy);
    border: 0.5px solid var(--color-navy-10);
}

/* ------------------------------- Microphone ------------------------------- */

.mic-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-muted);
    display: flex;
    align-items: center;
    padding: var(--space-xs);
    flex-shrink: 0;
    transition: color 0.15s;
    min-width: 28px;
    min-height: 28px;
}

.mic-btn.listening {
    color: var(--color-danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%   { opacity: 1; }
    50%  { opacity: 0.4; }
    100% { opacity: 1; }
}

/* ---------------------------------- Toast --------------------------------- */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    color: white;
    font-family: var(--font);
    font-size: 13px;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
    pointer-events: none;
}

.update-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-navy);
    color: white;
    font-family: var(--font);
    font-size: 13px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    z-index: 1000;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.update-toast button {
    background: var(--color-gold);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-family: var(--font);
    font-size: 12px;
    cursor: pointer;
}

.toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast--error   { background: var(--color-danger); }
.toast--success { background: var(--color-success); }
.toast--info    { background: var(--color-text); }

/* ---------------------------------- Forms --------------------------------- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.field-label {
  font-size: 14px;
  color: var(--color-muted);
  font-weight: 500;
}

.field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-input {
  width: 100%;
  background: var(--color-surface);
  border: 0.5px, solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px var(--space-md);
  font-family: var(--font);
  font-size: 16px;
  color: var(--color-text);
  direction: ltr;
  text-align: right;
  outline: none;
  transition: border-color 0.2s;
}

.field-input:focus {
  border-color: var(--color-navy);
}

.field-input::placeholder {
  color: var(--color-muted);
  direction: rtl;
}

.field-toggle {
  position: absolute;
  left: var(--space-sm);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  font-size: 16px;
  line-height: 1;
}

.btn-primary {
  width: 100%;
  background: var(--color-navy);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: var(--space-sm);
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--color-navy-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  width: 100%;
  background: none;
  border: none;
  color: var(--color-navy);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  padding: var(--space-sm);
  text-align: center;
}

.error-message {
  font-size: 12px;
  color: var(--color-danger);
  text-align: center;
  min-height: 20px;
  padding: var(--space-xs) 0;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    color: var(--color-navy);
    padding: var(--space-xs) 0;
    direction: ltr;
    margin-right: auto;
}

.hidden {
    display: none !important;
}

/* --------------------------------- Spinner -------------------------------- */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-navy);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}