/* 62CRM - AdminLTE Style - Premium Real Estate CRM */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --sidebar-width: 250px;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #2563eb;
  --topbar-height: 60px;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #06b6d4;
  --info-bg: #cffafe;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 10px -3px rgba(0,0,0,0.04);
  --transition: 0.2s ease;
}

* { box-sizing: border-box; }

body, .sixtytwo-app {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.sixtytwo-app { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width); min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000;
  transition: transform var(--transition);
}
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-logo { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.sidebar-close { display: none; background: none; border: none; color: #94a3b8; font-size: 24px; cursor: pointer; }
.sidebar-user {
  padding: 16px 20px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name { color: #fff; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: #94a3b8; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: #cbd5e1; text-decoration: none; font-weight: 500; font-size: 13px;
  transition: all var(--transition); margin-bottom: 2px;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-icon { font-size: 16px; width: 22px; text-align: center; }

.sidebar-footer { padding: 12px 8px; border-top: 1px solid rgba(255,255,255,0.06); }
.logout-link { color: #f87171; } .logout-link:hover { background: rgba(239,68,68,0.15); color: #fca5a5; }

/* ===== MAIN ===== */
.main-content { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: var(--topbar-height); display: flex; align-items: center;
  padding: 0 24px; background: var(--card-bg); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100; gap: 16px;
}
.hamburger { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text); padding: 4px; }
.topbar-title { font-size: 16px; font-weight: 700; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { color: var(--text-muted); font-size: 13px; font-weight: 500; }

.content { padding: 24px; flex: 1; }

/* ===== CARDS ===== */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-body { padding: 20px; }

/* ===== STATS GRID ===== */
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
  border-left: 4px solid var(--primary); transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.stat-total { border-left-color: var(--primary); }
.stat-card.stat-new { border-left-color: var(--info); }
.stat-card.stat-touching { border-left-color: var(--warning); }
.stat-card.stat-meeting { border-left-color: var(--primary); }
.stat-card.stat-deposit { border-left-color: var(--success); }
.stat-card.stat-dropped { border-left-color: var(--danger); }
.stat-number { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 12px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.6s ease; }

/* ===== TABLES ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); background: var(--bg); }
.data-table td { font-size: 13px; vertical-align: middle; }
.data-table tr:hover td { background: #f8fafc; }
.data-table a { color: var(--primary); text-decoration: none; font-weight: 600; }
.data-table a:hover { text-decoration: underline; }

/* ===== STATUS BADGES ===== */
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
  border: none; cursor: pointer; transition: all var(--transition);
}
.status-new { background: var(--info-bg); color: #0369a1; }
.status-touching { background: var(--warning-bg); color: #92400e; }
.status-meeting { background: var(--primary-light); color: #1d4ed8; }
.status-deposit { background: var(--success-bg); color: #065f46; }
.status-dropped { background: var(--danger-bg); color: #991b1b; }

select.status-badge { padding: 6px 24px 6px 10px; 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='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition); text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-info { background: var(--info); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-info:hover, .btn-danger:hover { opacity: 0.9; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-control {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
  background: var(--card-bg); transition: border var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ===== ALERTS ===== */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; font-size: 14px; }
.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }

/* ===== ACTIVITY LOG ===== */
.activity-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-time { font-size: 11px; color: var(--text-light); margin-bottom: 4px; }
.activity-text { font-size: 13px; color: var(--text); }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.modal-content { background: var(--card-bg); border-radius: var(--radius); width: 90%; max-width: 600px; max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow-lg); position: relative; padding: 24px; }
.modal-close { position: absolute; top: 16px; right: 16px; font-size: 24px; cursor: pointer; color: var(--text-muted); background: none; border: none; }
.modal-close:hover { color: var(--text); }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 20px;
}
.login-box { width: 100%; max-width: 400px; }
.login-header { text-align: center; color: #fff; font-size: 28px; margin-bottom: 8px; font-weight: 700; }
.login-sub { text-align: center; color: #94a3b8; font-size: 14px; margin-bottom: 24px; }
.login-box { width: 100%; max-width: 400px; }
.login-box form { background: #fff; border-radius: 16px; box-shadow: 0 25px 50px rgba(0,0,0,0.25); overflow: hidden; padding: 32px; }
.login-msg { text-align: center; margin: 0 0 24px; color: var(--text-muted); font-size: 14px; }
.login-box form .login-username label, .login-card-body .login-password label { font-size: 13px; font-weight: 600; color: var(--text); display: block; margin-bottom: 6px; }
.login-box form .login-username input, .login-box form .login-password input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 16px; font-family: inherit;
}
.login-box form .login-username input:focus, .login-box form .login-password input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.login-box form .login-remember { margin-bottom: 16px; }
.login-box form .login-remember label { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.login-box form .login-submit .button-primary {
  width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background var(--transition);
}
.login-box form .login-submit .button-primary:hover { background: var(--primary-dark); }
.login-footer { text-align: center; color: #94a3b8; font-size: 12px; margin-top: 16px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 999; }
  .main-content { margin-left: 0; }
  .hamburger { display: block; }
  .content { padding: 16px; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-responsive .data-table th:nth-child(n+5), .table-responsive .data-table td:nth-child(n+5) { display: none; }
  .table-responsive.expanded .data-table th, .table-responsive.expanded .data-table td { display: table-cell; }
}

@media (max-width: 480px) {
  .dashboard-stats { grid-template-columns: 1fr; }
  .card-header, .card-body { padding: 14px; }
}

/* ===== LOADING ===== */
.loading-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EXTRA ===== */
.row { display: flex; gap: 20px; flex-wrap: wrap; }
a { color: var(--primary); }

/* ===== SCROLLBAR ===== */
.sidebar-nav::-webkit-scrollbar, .card-body::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb, .card-body::-webkit-scrollbar-thumb { background: var(--sidebar-hover); border-radius: 2px; }
