@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #22c55e;
  --primary-dark: #16a34a;
  --secondary: #fbbf24;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --danger: #ef4444;
  --info: #3b82f6;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 2rem;
  }
}

/* Header */
header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
  }
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-section img {
  height: 48px;
  width: auto;
}

@media (min-width: 640px) {
  .logo-section img {
    height: 60px;
  }
}

.logo-section h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
}

@media (min-width: 640px) {
  .logo-section h1 {
    font-size: 1.25rem;
  }
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

/* Dashboard Cards */
.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 480px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
  }
}

.card {
  background: var(--card-bg);
  padding: 1.25rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid var(--border);
}

.card h3 {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.card .value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

/* Form Section */
.form-section {
  background: var(--card-bg);
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .form-section {
    padding: 2rem;
  }
}

.form-section h2 {
  font-size: 1.125rem;
  margin-bottom: 1.25rem;
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-form {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
}

.col-span-full {
  grid-column: 1 / -1;
}

input, select, textarea {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

button {
  cursor: pointer;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--bg);
}

/* Table Section */
.table-section {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.table-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .table-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

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

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: top;
}

.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-block;
}

.badge-masuk { background: #dcfce7; color: #166534; }
.badge-keluar { background: #fef9c3; color: #854d0e; }

.loading {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--primary);
  font-weight: 600;
}

.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid #fecaca;
  font-size: 0.9rem;
}

/* Print Styles */
@media print {
  .no-print { display: none !important; }
  body { background: white; }
  .container { max-width: 100%; padding: 0; }
  header { border-bottom: 2px solid var(--primary); }
  table { min-width: auto; }
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 1.5rem;
}

.login-card {
  background: white;
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  width: 100%;
  max-width: 400px;
  text-align: center;
  border: 1px solid var(--border);
}

.login-card img {
  height: 80px;
  margin-bottom: 1rem;
}

.login-card h1 {
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.login-card h2 {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 600;
}

.login-form {
  text-align: left;
}

.error-text {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.login-form button {
  margin-top: 20px;
}
