:root {
  --primary: #22c55e;
  --primary-dark: #16a34a;
  --dark-100: #0a0a0a;
  --dark-50: #111111;
  --gray-800: #1f1f1f;
  --gray-700: #2a2a2a;
  --gray-600: #3a3a3a;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: var(--dark-100);
  color: #fff;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.3);
}

.btn-secondary {
  background: var(--dark-50);
  color: #fff;
  border: 1px solid var(--gray-800);
}

.btn-secondary:hover {
  border-color: var(--gray-700);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--primary);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
  background: rgba(34, 197, 94, 0.2);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-300);
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--dark-50);
  border: 1px solid var(--gray-800);
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-input::placeholder {
  color: var(--gray-500);
}

.form-input-icon {
  position: relative;
}

.form-input-icon .icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
}

.form-input-icon input {
  padding-left: 48px;
}

/* Cards */
.card {
  background: var(--dark-50);
  border: 1px solid var(--gray-800);
  border-radius: 16px;
  padding: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-800);
}

th {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.badge-approved,
.badge-paid {
  background: rgba(34, 197, 94, 0.1);
  color: var(--primary);
}

.badge-rejected,
.badge-failed {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.badge-processing {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

/* Stats Card */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--dark-50);
  border: 1px solid var(--gray-800);
  border-radius: 16px;
  padding: 24px;
}

.stat-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.stat-card .icon.green {
  background: rgba(34, 197, 94, 0.1);
  color: var(--primary);
}

.stat-card .icon.blue {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.stat-card .icon.yellow {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.stat-card .icon.red {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--gray-400);
}

/* Alert */
.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--primary);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

/* Auth Layout */
.auth-container {
  min-height: 100vh;
  display: flex;
}

.auth-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth-right {
  flex: 1;
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.1),
    rgba(22, 163, 74, 0.05)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.auth-right::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(34, 197, 94, 0.1) 0%,
    transparent 70%
  );
}

.auth-box {
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-logo svg {
  width: 48px;
  height: 48px;
}

.auth-logo-text {
  font-size: 24px;
  font-weight: 800;
}

.auth-logo-text span {
  color: var(--primary);
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--gray-400);
  margin-bottom: 32px;
}

/* Admin Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--dark-50);
  border-right: 1px solid var(--gray-800);
  padding: 24px;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo:hover {
  text-decoration: none;
}

.sidebar-logo svg {
  width: 40px;
  height: 40px;
}

.sidebar-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.sidebar-logo-text span {
  color: var(--primary);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-800);
}

.sidebar-collapse-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--gray-800);
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.sidebar-collapse-btn:hover {
  background: var(--gray-700);
  color: #fff;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
  width: 80px;
  padding: 16px;
}

.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .sidebar-user-info {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.sidebar.collapsed .sidebar-logo {
  justify-content: center;
}

.sidebar.collapsed .sidebar-collapse-btn {
  position: absolute;
  right: -16px;
  top: 24px;
}

.sidebar.collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: 12px;
}

.sidebar.collapsed .sidebar-user {
  justify-content: center;
}

.sidebar.collapsed .sidebar-user-avatar {
  margin: 0;
}

.sidebar.collapsed .sidebar-logout {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
}

.main-content.expanded {
  margin-left: 80px;
}

.sidebar-nav {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav li {
  margin-bottom: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--gray-400);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.sidebar-nav a.active {
  background: rgba(34, 197, 94, 0.1);
  color: var(--primary);
}

.sidebar-nav a svg {
  width: 20px;
  height: 20px;
}

.sidebar-section {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 24px 0 12px 16px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 24px 0 12px 16px;
  padding: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--gray-400);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  margin-bottom: 4px;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  text-decoration: none;
}

.sidebar-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
  font-weight: 600;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--gray-800);
  margin-top: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #000;
  font-size: 16px;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  display: block;
  font-weight: 600;
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
}

.sidebar-logout {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  text-decoration: none;
}

.sidebar-logout:hover {
  background: rgba(34, 197, 94, 0.1);
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
}

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--gray-400);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--dark-50);
  border: 1px solid var(--gray-800);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--gray-800);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px;
  border-top: 1px solid var(--gray-800);
}

/* Responsive */
@media (max-width: 1024px) {
  .auth-right {
    display: none;
  }

  .sidebar {
    transform: translateX(-100%);
    z-index: 100;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 0 16px;
  }

  .btn {
    padding: 10px 18px;
    font-size: 13px;
  }

  /* Cards */
  .card {
    padding: 16px;
  }

  /* Tables responsive */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Forms */
  .form-group {
    margin-bottom: 12px;
  }

  input,
  select,
  textarea {
    font-size: 16px !important; /* Previne zoom no iOS */
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 12px;
  }

  .card {
    border-radius: 12px;
    padding: 14px;
  }

  /* Hide on mobile */
  .hide-mobile {
    display: none !important;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease;
}

/* Loading Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 16px;
}

/* Document Grid */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 16px;
}

.doc-card {
  background: var(--dark-100);
  border: 1px solid var(--gray-800);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.doc-card:hover {
  border-color: var(--green-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.doc-preview {
  position: relative;
  width: 100%;
  height: 200px;
  background: var(--dark-200);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.doc-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--dark-200);
  padding: 8px;
  transition: transform 0.3s ease;
}

.doc-preview:hover img {
  transform: scale(1.05);
}

.doc-preview::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.5));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.doc-card:hover .doc-preview::after {
  opacity: 1;
}

.doc-preview-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(34, 197, 94, 0.9);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2;
}

.doc-preview:hover .doc-preview-overlay {
  opacity: 1;
}

.doc-preview-overlay svg {
  color: white;
}

.doc-info {
  padding: 16px;
}

.doc-type {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--white);
}

.doc-name {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Document Modal/Lightbox */
.doc-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.doc-modal.active {
  display: flex;
  opacity: 1;
}

.doc-modal-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
}

.doc-modal-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.doc-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  transition: color 0.3s ease;
}

.doc-modal-close:hover {
  color: var(--green-primary);
}

.doc-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  padding: 16px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.doc-modal-nav:hover {
  background: rgba(34, 197, 94, 0.5);
}

.doc-modal-nav.prev {
  left: -60px;
}

.doc-modal-nav.next {
  right: -60px;
