/* css/style.css - MASTER THEME */
:root {
  --bg-dark: #0d1117;
  --card-bg: #161b22;
  --sidebar-bg: #161b22;
  --border-color: #30363d;
  --text-main: #c9d1d9;
  --text-muted: #8b949e;
  --accent-blue: #58a6ff;
  --btn-green: #238636;
  --btn-green-hover: #2ea44f;
  --danger: #ff7b72;
  --danger-bg: rgba(248, 81, 73, 0.1);
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  margin: 0;
  min-height: 100vh;
}

/* --- LAYOUT UTILITIES --- */
/* For Login/Landing/CreateUser pages */
body.centered-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: radial-gradient(#30363d 1px, transparent 1px);
  background-size: 30px 30px;
}

/* For Dashboard/UserList pages */
body.dashboard-layout {
  display: flex;
  flex-direction: row;
}

/* --- SIDEBAR --- */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px;
  flex-shrink: 0;
  height: 100vh;
  box-sizing: border-box;
}

.logo {
  font-size: 20px;
  font-weight: bold;
  color: #f0f6fc;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-item {
  padding: 12px 15px;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 6px;
  margin-bottom: 5px;
  transition: 0.2s;
  font-size: 14px;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(177, 186, 196, 0.12);
  color: #f0f6fc;
}

.logout {
  margin-top: auto;
  color: var(--danger);
}
.logout:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.main-content {
  flex-grow: 1;
  padding: 40px;
  overflow-y: auto;
  height: 100vh;
  box-sizing: border-box;
}

/* --- CARDS (Auth & Modals) --- */
.auth-card {
  width: 100%;
  max-width: 500px; /* Wider for Create User form */
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  position: relative;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}
.auth-header i {
  font-size: 48px;
  color: #fc6d26;
  margin-bottom: 15px;
}
.auth-header h2 {
  margin: 0 0 8px;
  color: #f0f6fc;
}

/* --- FORMS --- */
.form-group {
  margin-bottom: 16px;
}
.row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-main);
}

input,
select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: #f0f6fc;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 14px;
  transition: 0.2s;
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3);
}

.read-only-field {
  background: rgba(88, 166, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.3);
  color: #58a6ff;
  cursor: not-allowed;
}

/* --- BUTTONS --- */
.btn-primary,
.btn-add {
  background: var(--btn-green);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%; /* Default full width */
}
.btn-primary:hover,
.btn-add:hover {
  background: var(--btn-green-hover);
}

.btn-add {
  width: auto;
} /* Auto width for "Add User" button */

.btn-cancel {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  text-align: center;
  width: 100%;
}
.btn-cancel:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* --- ALERTS & LOADERS --- */
.alert {
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(248, 81, 73, 0.4);
  color: var(--danger);
}
.alert-success {
  background: rgba(46, 160, 67, 0.15);
  border: 1px solid rgba(46, 160, 67, 0.4);
  color: #3fb950;
}

.loading {
  text-align: center;
  color: var(--text-muted);
  display: none;
  margin-bottom: 15px;
  font-size: 14px;
}

/* --- TABLES --- */
.table-container {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}
th {
  background-color: #21262d;
  color: #f0f6fc;
  font-weight: 600;
}
tr:hover {
  background-color: rgba(110, 118, 129, 0.1);
}
td a {
  color: var(--accent-blue);
  text-decoration: none;
}
td a:hover {
  text-decoration: underline;
}

/* --- PROFILE CARD --- */
.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 30px;
  max-width: 800px;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 20px;
}
.avatar-circle {
  width: 70px;
  height: 70px;
  background: var(--accent-blue);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  font-weight: bold;
  color: white;
}
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
.data-group .value {
  font-size: 16px;
  color: white;
  font-weight: 500;
}

/* --- BADGES --- */
.badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-admin {
  background: rgba(56, 139, 253, 0.15);
  color: #58a6ff;
  border-color: rgba(56, 139, 253, 0.4);
}
.badge-user {
  background: rgba(46, 160, 67, 0.15);
  color: #3fb950;
  border-color: rgba(46, 160, 67, 0.4);
}

/* --- STEPS (JS Toggles) --- */
.step-section {
  display: none;
  animation: fadeIn 0.3s ease;
}
.step-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
