/* ============================================
   AXITRAQ — Global Application Styles
   ============================================ */

:root {
  --gold: #c9a227;
  --gold-light: #e0c35a;
  --gold-dark: #9a7a10;
  --blue: #1a5fb4;
  --blue-light: #3584e4;
  --blue-dark: #0d3b7a;
  --bg-primary: #0d0d0f;
  --bg-secondary: #141418;
  --bg-card: #1a1a20;
  --bg-input: #22222a;
  --bg-hover: #2a2a34;
  --border: #2e2e38;
  --border-light: #3a3a46;
  --text-primary: #e6e6e8;
  --text-secondary: #a0a0a8;
  --text-muted: #6a6a74;
  --success: #2ec27e;
  --warning: #e5a50a;
  --danger: #e01b24;
  --info: #3584e4;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --sidebar-width: 260px;
  --topbar-height: 56px;
}

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
}

a { color: var(--blue-light); text-decoration: none; }
a:hover { color: var(--gold); }

/* ---------- LOGIN PAGE ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.login-logo {
  font-weight: 700;
  font-size: 2rem;
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.login-logo .axi { color: var(--gold); }
.login-logo .traq { color: var(--blue); }

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
}

/* ---------- FORMS ---------- */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 95, 180, 0.2);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236a6a74' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.2rem;
}

textarea.form-control { resize: vertical; min-height: 80px; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover { background: var(--blue-light); color: #fff; }

.btn-gold {
  background: var(--gold);
  color: #000;
}
.btn-gold:hover { background: var(--gold-light); }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

.btn-block { width: 100%; }

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 1.2rem 1.5rem;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .axi { color: var(--gold); }
.sidebar-logo .traq { color: var(--blue); }

.sidebar-nav { flex: 1; padding: 0.8rem 0; }

.nav-section {
  padding: 0.4rem 1.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.8rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(201, 162, 39, 0.06);
}

.nav-icon { width: 18px; text-align: center; font-size: 1rem; }

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-user {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
}

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

/* ---------- CARDS ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
}

/* ---------- TABLES ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  text-align: left;
  padding: 0.7rem 0.8rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.data-table tr:hover td {
  background: var(--bg-hover);
}

/* ---------- BADGES ---------- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
}

.badge-active   { background: rgba(46,194,126,0.15); color: var(--success); }
.badge-inactive { background: rgba(106,106,116,0.15); color: var(--text-muted); }
.badge-warning  { background: rgba(229,165,10,0.15); color: var(--warning); }
.badge-danger   { background: rgba(224,27,36,0.15); color: var(--danger); }
.badge-info     { background: rgba(53,132,228,0.15); color: var(--info); }

/* ---------- ALERTS ---------- */
.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.alert-error   { background: rgba(224,27,36,0.12); color: var(--danger); border: 1px solid rgba(224,27,36,0.25); }
.alert-success { background: rgba(46,194,126,0.12); color: var(--success); border: 1px solid rgba(46,194,126,0.25); }
.alert-warning { background: rgba(229,165,10,0.12); color: var(--warning); border: 1px solid rgba(229,165,10,0.25); }
.alert-info    { background: rgba(53,132,228,0.12); color: var(--info); border: 1px solid rgba(53,132,228,0.25); }

/* ---------- STAT CARDS (Dashboard) ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
}

.stat-value.gold { color: var(--gold); }
.stat-value.blue { color: var(--blue-light); }

/* ---------- TABS ---------- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-item {
  padding: 0.7rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

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

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

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
