/* ═══ Rogov Estate Partner Portal — Dark Gold Theme ═══ */

:root {
  --bg-primary: #0D0B09;
  --bg-elevated: #151210;
  --bg-surface: #1C1916;
  --bg-card: rgba(198, 169, 108, 0.06);
  --bg-card-hover: rgba(198, 169, 108, 0.12);
  --bg-input: rgba(198, 169, 108, 0.04);
  --bg-input-focus: rgba(198, 169, 108, 0.08);

  --accent: #C6A96C;
  --accent-light: #E6D5A8;
  --accent-bright: #D4AF37;
  --accent-glow: rgba(198, 169, 108, 0.3);
  --accent-subtle: rgba(198, 169, 108, 0.08);

  --text-primary: #F5F0E8;
  --text-secondary: rgba(245, 240, 232, 0.6);
  --text-tertiary: rgba(245, 240, 232, 0.35);
  --text-on-accent: #0D0B09;

  --border-subtle: rgba(198, 169, 108, 0.1);
  --border-medium: rgba(198, 169, 108, 0.2);
  --border-accent: rgba(198, 169, 108, 0.4);

  --font-display: 'Inter Tight', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --sidebar-width: 260px;
  --header-height: 64px;

  --status-new: #5B9BF5;
  --status-selecting: #C6A96C;
  --status-viewing: #A78BFA;
  --status-negotiation: #38BDF8;
  --status-payment: #4ADE80;
  --status-postponed: #FB923C;
  --status-archive: rgba(245, 240, 232, 0.35);
  --status-cancelled: #F87171;

  --success: #4ADE80;
  --error: #F87171;
  --warning: #FB923C;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-light);
}

/* ═══ LAYOUT ═══ */

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar__logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar__logo img {
  width: 32px;
  height: 32px;
}

.sidebar__logo-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.sidebar__nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar__link:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.sidebar__link.active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.sidebar__link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar__link.active svg {
  opacity: 1;
}

.sidebar__footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar__manager {
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.sidebar__manager-label {
  color: var(--text-tertiary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.sidebar__manager-name {
  color: var(--text-primary);
  font-weight: 500;
}

.sidebar__manager-phone {
  color: var(--accent);
  font-size: 13px;
  margin-top: 4px;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.header {
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.header__user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.header__logout {
  color: var(--text-tertiary);
  font-size: 13px;
}

.content {
  padding: 32px;
  max-width: 1200px;
}

/* Mobile burger */
.burger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
}

.burger svg {
  width: 24px;
  height: 24px;
}

/* ═══ STATS CARDS ═══ */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: background 0.2s;
}

.stat-card:hover {
  background: var(--bg-card-hover);
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card__label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══ TABLE ═══ */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--bg-card-hover);
}

td a {
  color: var(--accent);
}

/* ═══ STATUS BADGE ═══ */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge--new { background: rgba(91, 155, 245, 0.15); color: #5B9BF5; }
.badge--selecting { background: rgba(198, 169, 108, 0.15); color: #C6A96C; }
.badge--viewing { background: rgba(167, 139, 250, 0.15); color: #A78BFA; }
.badge--negotiation { background: rgba(56, 189, 248, 0.15); color: #38BDF8; }
.badge--payment { background: rgba(74, 222, 128, 0.15); color: #4ADE80; }
.badge--postponed { background: rgba(251, 146, 60, 0.15); color: #FB923C; }
.badge--archive { background: rgba(245, 240, 232, 0.06); color: rgba(245, 240, 232, 0.35); }
.badge--cancelled { background: rgba(248, 113, 113, 0.15); color: #F87171; }
.badge--pending { background: rgba(251, 146, 60, 0.15); color: #FB923C; }
.badge--active { background: rgba(74, 222, 128, 0.15); color: #4ADE80; }
.badge--rejected { background: rgba(248, 113, 113, 0.15); color: #F87171; }

/* ═══ BUTTONS ═══ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: var(--text-on-accent);
}

.btn--primary:hover {
  background: var(--accent-bright);
  color: var(--text-on-accent);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--danger {
  background: rgba(248, 113, 113, 0.1);
  color: #F87171;
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn--danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ═══ FORMS ═══ */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group label .required {
  color: var(--accent);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  background: var(--bg-input-focus);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(245,240,232,0.35)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ═══ TABS ═══ */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ═══ CARDS ═══ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.detail-item__label {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.detail-item__value {
  font-size: 14px;
  color: var(--text-primary);
}

/* ═══ SEARCH / FILTER BAR ═══ */

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-bar input[type="search"] {
  flex: 1;
  min-width: 200px;
}

.filter-bar select {
  min-width: 180px;
  flex-shrink: 0;
}

/* ═══ ALERT MESSAGES ═══ */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
}

.alert--error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: #F87171;
}

.alert--success {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  color: #4ADE80;
}

.alert--info {
  background: rgba(198, 169, 108, 0.1);
  border: 1px solid rgba(198, 169, 108, 0.2);
  color: var(--accent);
}

/* ═══ SECTION TITLE ═══ */

.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

/* ═══ POINTS ═══ */

.points--positive { color: var(--success); }
.points--negative { color: var(--error); }

/* ═══ STATUS LOG TIMELINE ═══ */

.timeline {
  padding-left: 20px;
  border-left: 2px solid var(--border-subtle);
}

.timeline__item {
  position: relative;
  padding: 0 0 20px 16px;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline__date {
  font-size: 12px;
  color: var(--text-tertiary);
}

.timeline__text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ═══ AUTH PAGES ═══ */

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

.auth-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}

.auth-card__logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-card__logo img {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
}

.auth-card__logo h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
}

.auth-card__logo p {
  color: var(--text-tertiary);
  font-size: 14px;
  margin-top: 4px;
}

.auth-card .btn--primary {
  width: 100%;
  justify-content: center;
  padding: 12px;
  margin-top: 8px;
}

.auth-card__footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ═══ EMPTY STATE ═══ */

.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
}

.empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty__text {
  font-size: 15px;
  margin-bottom: 16px;
}

/* ═══ AUTOCOMPLETE ═══ */

.autocomplete {
  position: relative;
}

.autocomplete__input {
  width: 100%;
}

.autocomplete__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.autocomplete__item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background 0.15s;
}

.autocomplete__item:hover {
  background: var(--bg-card-hover);
}

.autocomplete__name {
  font-size: 14px;
  color: var(--text-primary);
}

.autocomplete__developer {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.autocomplete__empty {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.autocomplete__item--add {
  border-top: 1px solid var(--border-subtle);
  color: var(--accent);
}

.autocomplete__item--add:hover {
  background: rgba(198, 169, 108, 0.08);
}

.autocomplete__add-icon {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
}

.autocomplete__input--selected {
  border-color: var(--accent) !important;
  background: rgba(198, 169, 108, 0.06) !important;
}

/* ═══ RESPONSIVE ═══ */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .burger {
    display: block;
  }

  .content {
    padding: 20px 16px;
  }

  .header {
    padding: 0 16px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar select {
    width: 100%;
  }
}
