/* ===================================
   MAIN STYLESHEET - AturDuitku Pro
   =================================== */

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary: #ec4899;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #0ea5e9;

  --dark: #0f172a;
  --dark-light: #1e293b;
  --gray: #64748b;
  --gray-light: #cbd5e1;
  --gray-lighter: #f1f5f9;
  --white: #ffffff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.15);

  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--gray-lighter);
  color: var(--dark);
  line-height: 1.6;
  color-scheme: light;
}

/* Container Layout */
.container {
  display: flex;
  min-height: 100vh;
}

/* ===================================
   SIDEBAR
   =================================== */

.sidebar {
  width: 280px;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.sidebar-header {
  padding: 28px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.logo-icon {
  font-size: 32px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

.logo h2 {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.sidebar-nav ul {
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--border-radius);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: var(--transition);
  font-size: 14px;
  font-weight: 600;
  position: relative;
}

.nav-item:hover {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--white);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.3), transparent);
  color: var(--primary-light);
  border-left: 3px solid var(--primary);
  padding-left: 13px;
}

.nav-icon {
  font-size: 20px;
}

.nav-text {
  flex: 1;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================================
   MAIN CONTENT
   =================================== */

.main-content {
  margin-left: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f0f4ff 0%, #f9f5ff 100%);
}

/* Header */
.header {
  background: var(--white);
  padding: 28px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--gray-light);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.header-left h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--dark), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-subtitle {
  font-size: 14px;
  color: var(--gray);
  font-weight: 500;
}

.header-right {
  display: flex;
  gap: 12px;
}

/* Dashboard Section */
.dashboard {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 28px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border-left: 5px solid transparent;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1), transparent);
  border-radius: 50%;
  transform: translate(30px, -30px);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px);
}

.card-primary {
  border-left-color: var(--primary);
}

.card-primary::after {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.card-success {
  border-left-color: var(--success);
}

.card-danger {
  border-left-color: var(--danger);
}

.card-warning {
  border-left-color: var(--warning);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-icon {
  font-size: 32px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.card-value h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark);
  margin: 0 0 8px 0;
  position: relative;
  z-index: 1;
  word-break: break-word;
  overflow-wrap: break-word;
}

.card-subtitle {
  font-size: 12px;
  color: var(--gray);
  position: relative;
  z-index: 1;
}

.trend-up {
  color: var(--success);
  font-weight: 600;
}

.trend-down {
  color: var(--danger);
  font-weight: 600;
}

/* Quick Access */
.quick-access {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.quick-item {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
}

.quick-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(236, 72, 153, 0.05));
  border-radius: var(--border-radius);
  opacity: 0;
  transition: var(--transition);
}

.quick-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px) rotate(1deg);
  border-color: var(--primary);
}

.quick-item:hover::before {
  opacity: 1;
}

.quick-icon {
  font-size: 48px;
  min-width: 60px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.quick-content {
  flex: 1;
  position: relative;
  z-index: 1;
}

.quick-content h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
}

.quick-content p {
  font-size: 13px;
  color: var(--gray);
  margin: 0;
}

.quick-link {
  font-size: 20px;
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

.quick-link:hover {
  color: var(--primary-dark);
}

/* Recent Section */
.recent-section {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 28px;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--dark);
}

.view-all {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.view-all:hover {
  color: var(--primary-dark);
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.transaction-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background-color: var(--gray-lighter);
  border-radius: 8px;
  transition: var(--transition);
}

.transaction-item:hover {
  background-color: var(--gray-light);
}

.transaction-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.transaction-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background-color: var(--gray-lighter);
}

.transaction-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 2px;
}

.transaction-info p {
  font-size: 12px;
  color: var(--gray);
}

.transaction-amount {
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.amount-income {
  color: var(--success);
}

.amount-expense {
  color: var(--danger);
}

.goals-section {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 28px;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.goal-card {
  padding: 20px;
  background: linear-gradient(135deg, var(--white), var(--gray-lighter));
  border-radius: 12px;
  border: 2px solid var(--gray-light);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.goal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.goal-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.goal-card:hover::before {
  transform: scaleX(1);
}

.goal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.goal-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

.progress-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--gray-light);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width 0.3s ease;
}

.goal-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat {
  text-align: center;
}

.stat small {
  display: block;
  font-size: 11px;
  color: var(--gray);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.stat p {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray);
}

/* Chart Section */
.chart-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.chart-container {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.chart-container h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 20px;
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-100%);
  transition: var(--transition);
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
  transform: translateY(-3px);
}

.btn-secondary {
  background-color: var(--gray-light);
  color: var(--dark);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--gray);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
  transform: translateY(-3px);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
  transform: translateY(-3px);
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* ===================================
   FORMS
   =================================== */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-light);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  background-color: var(--gray-lighter);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--white);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ===================================
   MODAL
   =================================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--gray-light);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray);
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--dark);
}

.modal-content form {
  padding: 24px;
}

/* ===================================
   TABLE
   =================================== */

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table thead th {
  background-color: var(--gray-lighter);
  color: var(--dark);
  font-weight: 700;
  padding: 12px;
  text-align: left;
  border-bottom: 2px solid var(--gray-light);
}

table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--gray-light);
}

table tbody tr:hover {
  background-color: var(--gray-lighter);
}

.table-actions {
  display: flex;
  gap: 8px;
}

/* ===================================
   ALERT
   =================================== */

.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.alert-success {
  background-color: #f0fdf4;
  border-left-color: var(--success);
  color: #166534;
}

.alert-danger {
  background-color: #fef2f2;
  border-left-color: var(--danger);
  color: #7f1d1d;
}

.alert-warning {
  background-color: #fffbeb;
  border-left-color: var(--warning);
  color: #92400e;
}

.alert-info {
  background-color: #f0f9ff;
  border-left-color: var(--info);
  color: #0c2d6b;
}

/* ===================================
   SCROLLBAR
   =================================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--gray-lighter);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray);
}

/* ===================================
   UTILITIES
   =================================== */

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-0 {
  margin-top: 0;
}
.mt-8 {
  margin-top: 8px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-24 {
  margin-top: 24px;
}

.mb-0 {
  margin-bottom: 0;
}
.mb-8 {
  margin-bottom: 8px;
}
.mb-16 {
  margin-bottom: 16px;
}
.mb-24 {
  margin-bottom: 24px;
}

.gap-8 {
  gap: 8px;
}
.gap-12 {
  gap: 12px;
}
.gap-16 {
  gap: 16px;
}
.gap-24 {
  gap: 24px;
}

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}
