/* css/style.css */
:root {
  --primary-color: #5D33FF;
  --primary-hover: #4a22e0;
  --primary-light: rgba(93, 51, 255, 0.1);
  --secondary-color: #A3AED0;
  --bg-color: #F8F7FF;
  --surface-color: #ffffff;
  --text-main: #1A1A1A;
  --text-muted: #6B7280;
  --border-color: #E2E8F0;
  --danger: #EE5D50;
  --success: #01B574;
  --warning: #FFCE20;
  --shadow-sm: 0 4px 6px rgba(93, 51, 255, 0.04);
  --shadow-md: 0 18px 40px rgba(93, 51, 255, 0.10);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
}

.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: 280px;
  background-color: var(--surface-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  z-index: 100;
}

.sidebar-header {
  padding: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary-color);
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-brand-main {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--primary-color);
  line-height: 1.1;
}

.sidebar-brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1;
}

.sidebar-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sidebar-menu {
  list-style: none;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 500;
  transition: var(--transition);
}

.sidebar-menu li a i {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-menu li.active a,
.sidebar-menu li a:hover {
  background-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 5px 14px rgba(93, 51, 255, 0.25);
  transform: translateX(-4px);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100vh;
}

/* --- Topbar --- */
.topbar {
  background-color: rgba(244, 247, 254, 0.5);
  backdrop-filter: blur(10px);
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: var(--surface-color);
  padding: 12px 24px;
  border-radius: 30px;
  box-shadow: var(--shadow-sm);
  width: 400px;
  gap: 12px;
}

.search-bar i {
  color: var(--text-muted);
}

.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 15px;
  color: var(--text-main);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 24px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1.5rem; /* ~24px */
}

.user-info .icon-bell {
  font-size: 22px;
  color: #6c757d;
  cursor: pointer;
  transition: var(--transition);
}

.user-info .icon-bell:hover {
  color: var(--primary-color);
}

.user-profile-circle {
  position: relative;
  display: inline-block;
  cursor: pointer;
  transition: all 0.3s ease;
}

.avatar-circle-text {
  min-width: 48px;
  height: 48px;
  border-radius: 50px;
  background-color: #f4ebff;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  padding: 4px 16px 4px 4px;
  box-shadow: 0 2px 10px rgba(108, 60, 233, 0.15);
  border: 2px solid #ffffff;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.avatar-initials {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar-greeting {
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

.user-profile-circle:hover .avatar-circle-text {
  box-shadow: 0 4px 15px rgba(108, 60, 233, 0.25);
  transform: translateY(-2px);
}

/* User Real Dropdown Menu */
.user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 15px);
  left: 0;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  width: 220px;
  z-index: 1000;
  overflow: hidden;
  border: 1px solid #f1f1f1;
  padding: 8px 0;
}

.user-menu.show {
  display: flex !important;
  flex-direction: column;
  animation: slideDownMenu 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes slideDownMenu {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #4a4a4a;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.menu-item:hover {
  background-color: #f8f5ff;
  color: var(--primary-color);
}

.menu-item.text-danger:hover {
  background-color: #fff5f5;
  color: #dc3545 !important;
}

.menu-divider {
  height: 1px;
  background-color: #f1f1f1;
  margin: 6px 0;
}


/* --- Page Content --- */
.page-content {
  padding: 30px 40px;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
}

/* --- Buttons --- */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 10px rgba(93, 51, 255, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(93, 51, 255, 0.3);
}

.btn-secondary {
  background-color: #e2e8f0;
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

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

.btn-success {
  background-color: var(--success);
  color: white;
  box-shadow: 0 4px 10px rgba(1, 181, 116, 0.24);
}

.btn-success:hover {
  background-color: #019a62;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(1, 181, 116, 0.32);
}

.btn-warning {
  background-color: var(--warning);
  color: #1f2937;
  box-shadow: 0 4px 10px rgba(255, 206, 32, 0.22);
}

.btn-warning:hover {
  background-color: #f5bf07;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 206, 32, 0.3);
}

.btn-info {
  background-color: #2da8ff;
  color: white;
  box-shadow: 0 4px 10px rgba(45, 168, 255, 0.24);
}

.btn-info:hover {
  background-color: #1398f4;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(45, 168, 255, 0.34);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

/* --- Tables --- */
.table-wrapper {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: right;
  padding: 16px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 500;
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* --- Modals --- */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(11, 20, 55, 0.5);
  backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(5px); }
}

.modal-content {
  background-color: var(--surface-color);
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-md);
  transform: translateY(20px);
  animation: slideUp 0.3s ease-out forwards;
  overflow: hidden;
}

@keyframes slideUp {
  to { transform: translateY(0); }
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 20px;
  color: var(--text-main);
}

.close {
  cursor: pointer;
  font-size: 24px;
  color: var(--text-muted);
  transition: var(--transition);
}

.close:hover {
  color: var(--danger);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: #f8fafc;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-main);
  font-size: 14px;
}

.form-group small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 15px;
  color: var(--text-main);
  transition: var(--transition);
  background-color: #fff;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(93, 51, 255, 0.1);
}

/* --- Cards (like in accounts.html) --- */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.account-card {
    background: var(--surface-color);
    padding: 30px 24px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.account-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.account-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.icon.bg-primary { background: linear-gradient(135deg, #5D33FF, #7C5CFC); }
.icon.bg-info { background: linear-gradient(135deg, #39B8FF, #9CE6FF); }
.icon.bg-success { background: linear-gradient(135deg, #01B574, #48F5A6); }
.icon.bg-warning { background: linear-gradient(135deg, #FFCE20, #FFE17D); }
.icon.bg-danger { background: linear-gradient(135deg, #EE5D50, #FF9B9B); }

.account-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.account-card p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Action Badges in accounts Modals */
.balance-preview {
    margin-top: 10px;
    padding: 10px 15px;
    background-color: #F8F7FF;
    border-radius: 8px;
    color: #5D33FF;
    font-size: 13px;
    font-weight: bold;
}
