/* ============================================
   POI TRACKER ADMIN — Global Styles
   Inspired by InternetIndibiz.com
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand Colors — Indibiz Blue */
  --primary: #1A6FE8;
  --primary-hover: #1558C0;
  --primary-light: #E8F1FD;
  --primary-lighter: #F0F7FF;

  /* Sidebar */
  --sidebar-bg: #0B1929;
  --sidebar-hover: #132D4A;
  --sidebar-active: #1A3D5C;
  --sidebar-text: #8BA3C1;
  --sidebar-text-active: #FFFFFF;
  --sidebar-width: 260px;

  /* Neutrals */
  --bg: #F4F7FC;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #F1F5F9;

  /* Text */
  --text: #1B2559;
  --text-secondary: #64748B;
  --text-tertiary: #94A3B8;

  /* Status */
  --green: #10B981;
  --green-bg: #ECFDF5;
  --red: #EF4444;
  --red-bg: #FEF2F2;
  --orange: #F59E0B;
  --orange-bg: #FFFBEB;
  --blue: #3B82F6;
  --blue-bg: #EFF6FF;
  --purple: #8B5CF6;
  --purple-bg: #F5F3FF;

  /* Layout */
  --header-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.1);

  /* Font */
  --font: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

/* Reset */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { font-size:14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration:none; color:inherit; }
button { cursor:pointer; font-family:var(--font); }
input, select, textarea { font-family:var(--font); }

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

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease;
}

.sidebar-brand {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand .logo {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
}
.sidebar-brand .brand-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.sidebar-brand .brand-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}
.sidebar-nav::-webkit-scrollbar { width:4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background:rgba(255,255,255,.1); border-radius:4px; }

.nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.25);
  padding: 16px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  margin-bottom: 2px;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.nav-item.active {
  background: var(--primary);
  color: #fff;
}
.nav-item .icon {
  width: 20px;
  height: 20px;
  opacity: .7;
  flex-shrink: 0;
}
.nav-item.active .icon { opacity:1; }

.nav-sub { padding-left: 20px; }
.nav-sub .nav-item { font-size: 12.5px; padding: 8px 12px; }

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 12px 0;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
}
.sidebar-user .avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user .user-info { flex:1; min-width:0; }
.sidebar-user .user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .user-role {
  font-size: 11px;
  color: var(--sidebar-text);
}

.btn-logout {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: transparent;
  color: var(--sidebar-text);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all .15s;
}
.btn-logout:hover {
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.3);
  color: #EF4444;
}

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

.header {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-title h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.header-title p {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: -1px;
}
.header-actions { display:flex; align-items:center; gap:10px; }

.page-content {
  padding: 28px;
  max-width: 1400px;
}

/* Mobile toggle */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 8px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 40;
}

/* ============================================
   COMPONENTS
   ============================================ */

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-header h2 {
  font-size: 15px;
  font-weight: 700;
}
.card-header p {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-hover); box-shadow:var(--shadow-md); }
.btn-outline { background:transparent; border:1px solid var(--border); color:var(--text); }
.btn-outline:hover { border-color:var(--primary); color:var(--primary); }
.btn-sm { padding:6px 12px; font-size:12px; border-radius:6px; }
.btn-green { background:var(--green-bg); color:var(--green); }
.btn-green:hover { background:#D1FAE5; }
.btn-red { background:var(--red-bg); color:var(--red); }
.btn-red:hover { background:#FEE2E2; }
.btn-orange { background:var(--orange-bg); color:var(--orange); }
.btn-purple { background:var(--purple-bg); color:var(--purple); }
.btn-block { width:100%; justify-content:center; }

/* Form */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border .2s, box-shadow .2s;
}
.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-input::placeholder { color:var(--text-tertiary); }

/* Table */
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th {
  text-align:left;
  padding:10px 14px;
  font-size:11px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:var(--text-tertiary);
  border-bottom:2px solid var(--border);
  white-space:nowrap;
}
td {
  padding:12px 14px;
  border-bottom:1px solid var(--border-light);
  white-space:nowrap;
}
tr:hover td { background:var(--primary-lighter); }

/* Badge */
.badge {
  display:inline-flex;
  align-items:center;
  padding:3px 10px;
  border-radius:20px;
  font-size:11px;
  font-weight:600;
}
.badge-green { background:var(--green-bg); color:var(--green); }
.badge-red { background:var(--red-bg); color:var(--red); }
.badge-blue { background:var(--blue-bg); color:var(--blue); }
.badge-orange { background:var(--orange-bg); color:var(--orange); }
.badge-purple { background:var(--purple-bg); color:var(--purple); }

/* Stats */
.stats-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(200px,1fr));
  gap:16px;
  margin-bottom:24px;
}
.stat-card {
  background:var(--white);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
  box-shadow:var(--shadow);
}
.stat-card .stat-value {
  font-size:28px;
  font-weight:800;
  color:var(--text);
  line-height:1;
}
.stat-card .stat-label {
  font-size:12px;
  font-weight:500;
  color:var(--text-tertiary);
  margin-top:4px;
}

/* Toast */
.toast-container { position:fixed; bottom:24px; right:24px; z-index:200; }
.toast {
  padding:12px 20px;
  border-radius:var(--radius-sm);
  font-size:13px;
  font-weight:500;
  color:#fff;
  opacity:0;
  transform:translateY(10px);
  transition:all .3s;
  margin-top:8px;
}
.toast.show { opacity:1; transform:translateY(0); }
.toast-success { background:var(--green); }
.toast-error { background:var(--red); }

/* Modal */
.modal-overlay {
  display:none;
  position:fixed;
  inset:0;
  background:rgba(11,25,41,.6);
  backdrop-filter:blur(4px);
  z-index:100;
  align-items:center;
  justify-content:center;
}
.modal-overlay.open { display:flex; }
.modal {
  background:var(--white);
  border-radius:16px;
  padding:32px;
  width:100%;
  max-width:480px;
  box-shadow:var(--shadow-lg);
  max-height:90vh;
  overflow-y:auto;
}
.modal h2 { font-size:17px; font-weight:700; margin-bottom:4px; }
.modal .modal-sub { font-size:13px; color:var(--text-tertiary); margin-bottom:24px; }
.modal-actions { display:flex; gap:10px; margin-top:24px; }
.modal-actions .btn { flex:1; justify-content:center; }

/* Empty state */
.empty-state {
  padding:60px 20px;
  text-align:center;
  color:var(--text-tertiary);
}
.empty-state .empty-icon { font-size:40px; margin-bottom:12px; }
.empty-state p { font-size:14px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .sidebar-toggle {
    display: block;
  }
  .main {
    margin-left: 0;
  }
  .page-content {
    padding: 16px;
  }
  .header {
    padding: 0 16px;
  }
}

/* ============================================
   LOGIN PAGE (standalone, no sidebar)
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #0B1929 0%, #132D4A 50%, #1A6FE8 100%);
}
.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-card .login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.login-card .login-logo .logo {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
}
.login-card .login-logo .logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.login-card h1 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}
.login-card .login-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}
.login-card .form-input {
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 10px;
}
.login-card .btn-primary {
  padding: 12px;
  font-size: 14px;
  border-radius: 10px;
}
.login-error {
  background: var(--red-bg);
  color: var(--red);
  font-size: 12.5px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: none;
}
.login-error.show { display:block; }

.login-forgot {
  text-align: center;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--text-tertiary);
}
.login-forgot a {
  color: var(--primary);
  font-weight: 600;
}
.login-forgot a:hover { text-decoration:underline; }

@media (max-width: 480px) {
  .login-card { padding:32px 24px; border-radius:16px; }
}
