/* =====================================================
   RESET & BASE STYLES
===================================================== */
:root {
  --primary: #111827;
  --primary-dark: #000000;
  --secondary: #4f46e5;
  --danger: #e53935;
  --danger-dark: #c62828;
  --success: #10b981;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #f5f7fb;
  --white: #ffffff;
  --border: #e5e7eb;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.12);
  --radius: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* =====================================================
   AUTH PAGE - IMPROVED CENTERING & LAYOUT
===================================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #f0f4ff, #f8fafc);
  position: relative;
  overflow: hidden;
}

/* Subtle background pattern */
.auth-page::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(120, 119, 198, 0.03) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(255, 119, 198, 0.03) 0%, transparent 20%);
  z-index: 0;
}

/* CARD CONTAINER */
.auth-card {
  width: 100%;
  max-width: 1000px;
  min-height: 540px;
  background: var(--white);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.9);
}

/* BRAND SIDE - IMPROVED VISUAL */
.auth-brand {
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary), #8b5cf6);
}

.auth-brand h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-brand > p {
  font-size: 1.1rem;
  color: #d1d5db;
  margin-bottom: 40px;
  opacity: 0.9;
}

.auth-brand ul {
  list-style: none;
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-brand li {
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  color: #e5e7eb;
  padding: 8px 0;
  position: relative;
  padding-left: 32px;
}

.auth-brand li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
  font-size: 1rem;
  background: rgba(16, 185, 129, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* TAGLINE STYLE */
.brand-tagline {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 20px 0;
  color: #9ca3af;
}

/* FORM SIDE */
.auth-form {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.auth-form form {
  width: 100%;
  max-width: 380px;
  background: var(--white);
  padding: 40px 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: transform 0.3s ease;
}

.auth-form form:hover {
  transform: translateY(-2px);
}

/* FORM TITLE */
.auth-form h2 {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.auth-subtitle {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 32px;
}

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: var(--white);
}

.form-group input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ALERT STYLES */
.alert {
  background: #fee2e2;
  color: var(--danger-dark);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 24px;
  border-left: 4px solid var(--danger);
}

/* AUTH FOOTER */
.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-light);
}

.auth-footer a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.auth-footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* =====================================================
   BUTTON STYLES
===================================================== */
.btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn-block {
  width: 100%;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-dark);
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* =====================================================
   DASHBOARD LAYOUT (TIDAK DIRUBAH)
===================================================== */
/* =====================================================
   DASHBOARD STYLES - IMPROVED
===================================================== */
.dashboard {
  display: flex;
  min-height: 100vh;
  gap: 20px;
  background: #f8fafc;
}

/* Main content area */
.main {
  flex: 1;
  padding: 20px;
  background: #f8fafc;
  min-height: 100vh;
}

.main h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.main > p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

/* Dashboard grid layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* Card styles */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Stat card */
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 180px;
}

.card-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin: 10px 0;
}

.stat-card p:last-child {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 8px;
}

/* Chart card */
.chart-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.chart-card canvas {
  flex: 1;
  max-height: 200px;
  width: 100% !important;
}

/* Table container */
.table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 8px;
}

/* Table styles */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 600px;
}

thead {
  background: #f9fafb;
}

th {
  font-weight: 600;
  color: var(--text);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:hover {
  background: #f9fafb;
}

/* Badge styles for table */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  min-width: 70px;
}

.status-badge.good {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.broke {
  background: #fee2e2;
  color: #991b1b;
}

/* Action buttons */
.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Loading state */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-light);
}

.loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin-left: 10px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =====================================================
   RESPONSIVE DASHBOARD
===================================================== */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 992px) {
  .main {
    padding: 16px;
  }
  
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
  }
  
  .card-number {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .dashboard {
    flex-direction: column;
    gap: 0;
  }
  
  .main {
    padding: 16px;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .card {
    padding: 16px;
  }
  
  .chart-card {
    min-height: 240px;
  }
  
  .stat-card {
    min-height: 160px;
  }
  
  .card-number {
    font-size: 2.25rem;
  }
  
  table {
    font-size: 0.8125rem;
    min-width: 500px;
  }
  
  th, td {
    padding: 10px 12px;
  }
}

@media (max-width: 576px) {
  .main h1 {
    font-size: 1.5rem;
  }
  
  .card h3 {
    font-size: 0.9375rem;
  }
  
  .card-number {
    font-size: 2rem;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 6px;
  }
  
  .btn-sm {
    padding: 5px 10px;
    font-size: 0.6875rem;
  }
}
/* =====================================================
   SIDEBAR
===================================================== */
.sidebar {
  width: 220px;
  background: var(--primary);
  color: var(--white);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  margin-bottom: 36px;
}

.sidebar-header h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-nav a {
  color: var(--white);
  font-size: 14px;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 24px 0;
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-footer a {
  color: #ffb4b4;
}

.sidebar-footer a:hover {
  background: rgba(255, 0, 0, 0.15);
}

/* =====================================================
   MAIN
===================================================== */
.main {
  flex: 1;
  padding: 24px;
}

.main h1 {
  font-size: 24px;
  margin-bottom: 16px;
}

/* =====================================================
   CARD
===================================================== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

/* =====================================================
   TABLE
===================================================== */
.table-wrapper {
  max-height: 400px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  border-collapse: collapse;
  font-size: 14px;
  width: 100%;
}

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f9fafb;
  font-weight: 600;
  position: sticky;
  top: 0;
  color: var(--primary);
}

/* action */
.action-col {
  width: 120px;
  text-align: center;
}

/* badge */
.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

.badge.good {
  background: var(--primary);
  color: var(--white);
}

.badge.broke {
  background: #f3f4f6;
  color: var(--text);
}

/* =====================================================
   FOOTER
===================================================== */
.footer {
  margin-top: auto;
  padding: 16px 0;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  border-top: 1px solid var(--border);
}

/* =====================================================
   UTILITIES
===================================================== */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* =====================================================
   RESPONSIVE BREAKPOINTS
===================================================== */
@media (max-width: 992px) {
  .auth-card {
    max-width: 90%;
    min-height: 500px;
  }
  
  .auth-brand h1 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .auth-card {
    grid-template-columns: 1fr;
    max-width: 450px;
  }

  .auth-brand {
    padding: 32px;
    text-align: center;
  }

  .auth-brand li {
    justify-content: center;
  }

  .auth-form {
    padding: 32px;
  }

  .auth-form form {
    padding: 32px 24px;
  }

  .dashboard {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .main {
    padding: 16px;
  }

  table {
    font-size: 13px;
  }

  th,
  td {
    white-space: normal;
    word-break: break-word;
    padding: 8px 6px;
  }

  .action-col {
    width: 72px;
  }
}

@media (max-width: 480px) {
  .auth-page {
    padding: 16px;
  }
  
  .auth-card {
    min-height: auto;
  }
  
  .auth-brand,
  .auth-form {
    padding: 24px;
  }
  
  .auth-form h2 {
    font-size: 1.75rem;
  }
  
  .auth-brand h1 {
    font-size: 1.75rem;
  }
}
/* =====================================================
   SELECT THEME FIX (ANTI DEFAULT)
===================================================== */
select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
  font-family: inherit;
  background-color: #fff;
  color: #111;

  /* hilangkan default arrow */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* arrow custom simple */
  background-image:
    linear-gradient(45deg, transparent 50%, #555 50%),
    linear-gradient(135deg, #555 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

/* focus sama seperti input */
select:focus {
  outline: none;
  border-color: #111;
}

/* placeholder option */
select option[value=""] {
  color: #999;
}

