/* ============================================
   iShopfy ERP - Design System
   Font: SF Pro (Apple)
   ============================================ */

@import url('https://fonts.cdnfonts.com/css/sf-pro-display');

:root {
  --apple-blue: #007AFF;
  --apple-green: #34C759;
  --apple-orange: #FF9500;
  --apple-red: #FF3B30;
  --apple-purple: #AF52DE;
  --apple-white: #FFFFFF;
  --apple-gray-1: #F5F5F7;
  --apple-gray-2: #E8E8ED;
  --apple-gray-3: #D2D2D7;
  --apple-gray-4: #AEAEB2;
  --apple-gray-5: #86868B;
  --apple-gray-6: #636366;
  --apple-black: #1D1D1F;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* background: radial-gradient(ellipse 800px 600px at center, 
    #BB9CDF 0%,
    #474EA8 40%,
    #0D1C49 70%, 
    #F3F3F6 100%
  
    )!important; */
  background: #F3F3F6 !important;
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--apple-black);
  line-height: 1.6;
  overflow-x: hidden;
}

#content {
  background: radial-gradient(ellipse 800px 600px at center, 
    rgba(13, 28, 73, 0.40) 0%,
    rgba(71, 78, 168, 0.40) 40%,
    rgba(187, 156, 223, 0.40) 70%, 
    rgba(255, 162, 93, 0.40) 100%
    )!important;
}

/* LOGIN */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.login-box {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: var(--spacing-2xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 420px;
  max-width: 90%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-logo {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.login-logo img {
  width: 180px;
  height: auto;
  margin-bottom: var(--spacing-md);
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--apple-black);
  margin-bottom: var(--spacing-xs);
}

.login-logo p {
  font-size: 15px;
  color: var(--apple-gray-5);
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--apple-gray-6);
  margin-bottom: var(--spacing-sm);
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  border: 1px solid var(--apple-gray-3);
  border-radius: var(--radius-md);
  background: var(--apple-white);
  transition: all var(--transition-fast);
}

.form-group input:focus {
  outline: none;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.btn-login {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--apple-white);
  background: var(--apple-blue);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
}

.btn-login:hover {
  background: #0051D5;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* APP CONTAINER */
.app-container {
  display: flex;
  min-height: 100vh;
  background: transparent;
}

.hidden {
  display: none !important;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border-right: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: var(--spacing-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
}

.sidebar-logo img {
  width: 140px;
  height: auto;
}

.sidebar-menu {
  flex: 1;
  padding: var(--spacing-md);
  overflow-y: auto;
}

.sidebar-menu::-webkit-scrollbar {
  width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(174, 174, 178, 0.3);
  border-radius: var(--radius-full);
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(174, 174, 178, 0.5);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: 12px 16px;
  margin-bottom: var(--spacing-xs);
  color: var(--apple-gray-6);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.menu-item i {
  width: 20px;
  font-size: 18px;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.5);
  color: var(--apple-black);
  backdrop-filter: blur(10px);
  transform: translateX(4px);
}

.menu-item.active {
  background: var(--apple-blue);
  color: var(--apple-white);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
  transform: translateX(4px);
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: 280px;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.header {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  padding: var(--spacing-lg) var(--spacing-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 88px;
}

.header-title h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--apple-black);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search i {
  position: absolute;
  left: 12px;
  color: var(--apple-gray-5);
}

.header-search input {
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--apple-gray-3);
  border-radius: var(--radius-md);
  font-size: 14px;
  width: 250px;
  background: rgba(255, 255, 255, 0.8);
  transition: all var(--transition-fast);
}

.header-search input:focus {
  outline: none;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--apple-blue);
  color: var(--apple-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--apple-black);
}

.user-role {
  font-size: 12px;
  color: var(--apple-gray-5);
}

/* CONTENT */
.content {
  flex: 1;
  padding: var(--spacing-xl);
}

/* CARDS */
.card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all var(--transition-fast);
}

.card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
}

.table-container th, .table-container td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--apple-gray-4);
}

.table-container th {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  font-weight: 600;
  color: var(--apple-gray-6);
}

.table-container tr:hover {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
}

/* STATS CARDS */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacing-lg);
}

.stat-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all var(--transition-fast);
}

.stat-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: var(--spacing-md);
}

.stat-icon.blue { background: rgba(0, 122, 255, 0.1); color: var(--apple-blue); }
.stat-icon.green { background: rgba(52, 199, 89, 0.1); color: var(--apple-green); }
.stat-icon.orange { background: rgba(255, 149, 0, 0.1); color: var(--apple-orange); }
.stat-icon.red { background: rgba(255, 59, 48, 0.1); color: var(--apple-red); }

.stat-label {
  font-size: 13px;
  color: var(--apple-gray-5);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--apple-black);
}

/* BUTTONS */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
}

.btn-primary {
  background: var(--apple-blue);
  color: var(--apple-white);
}

.btn-primary:hover {
  background: #0051D5;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--apple-gray-2);
  color: var(--apple-black);
}

.btn-secondary:hover {
  background: var(--apple-gray-3);
}

.btn-danger {
  background: var(--apple-red);
  color: var(--apple-white);
}

.btn-danger:hover {
  background: #d32f2f;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
  display: block;
}

/* FORM CONTROLS */
.form-control, select.form-control, textarea.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--apple-gray-3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  transition: all var(--transition-fast);
  background: var(--apple-white);
}

.form-control:focus, select.form-control:focus, textarea.form-control:focus {
  outline: none;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* BADGE */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(52, 199, 89, 0.15);
  color: var(--apple-green);
}

.badge-warning {
  background: rgba(255, 149, 0, 0.15);
  color: var(--apple-orange);
}

.badge-danger {
  background: rgba(255, 59, 48, 0.15);
  color: var(--apple-red);
}

/* UTILITY */
.loading-content {
  text-align: center;
  padding: var(--spacing-2xl);
  color: var(--apple-gray-5);
}

/* TOAST NOTIFICATION */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--apple-white);
  box-shadow: var(--shadow-xl);
  transform: translateX(400px);
  transition: transform var(--transition-base);
  z-index: 10000;
  max-width: 400px;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background: var(--apple-green);
}

.toast.error {
  background: var(--apple-red);
}

.toast.info {
  background: var(--apple-blue);
}

.toast.warning {
  background: var(--apple-orange);
}
