/* =============================================
   TIPREON - Main Stylesheet
   White / Light Theme  ·  Orange Brand
   ============================================= */

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

:root {
  /* Backgrounds */
  --bg-base:       #F8FAFC;
  --bg-secondary:  #FFFFFF;
  --bg-card:       #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --bg-muted:      #F1F5F9;

  /* Borders */
  --border:        #E2E8F0;
  --border-hover:  #F97316;
  --border-focus:  #F97316;

  /* Brand — Orange */
  --primary:        #F97316;
  --primary-dark:   #EA6C0A;
  --primary-light:  #FED7AA;
  --primary-glow:   rgba(249,115,22,0.18);
  --primary-glow2:  rgba(249,115,22,0.07);

  /* Accent */
  --red:     #EF4444;
  --green:   #22C55E;
  --blue:    #3B82F6;
  --purple:  #8B5CF6;
  --yellow:  #F59E0B;
  --cyan:    #06B6D4;
  --orange:  #F97316;

  /* Text */
  --text:       #0F172A;
  --text-dim:   #334155;
  --text-muted: #94A3B8;
  --text-light: #CBD5E1;

  /* Sidebar */
  --sidebar-width: 256px;
  --header-height: 68px;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:   0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm:   0 4px 6px rgba(15,23,42,0.07), 0 2px 4px rgba(15,23,42,0.05);
  --shadow-md:   0 10px 24px rgba(15,23,42,0.08), 0 4px 8px rgba(15,23,42,0.04);
  --shadow-lg:   0 20px 48px rgba(15,23,42,0.10), 0 8px 16px rgba(15,23,42,0.05);
  --shadow-xl:   0 32px 64px rgba(15,23,42,0.12);
  --shadow-brand: 0 8px 32px rgba(249,115,22,0.28);
  --shadow-card: 0 2px 8px rgba(15,23,42,0.06);

  --transition:      all 0.22s ease;
  --transition-slow: all 0.38s ease;
}

/* =============================================
   BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-muted); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* =============================================
   KEYFRAME ANIMATIONS
   ============================================= */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp  { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown{ from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInLeft{ from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeInRight{ from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: translateX(0); } }
@keyframes float     { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes floatSlow { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-18px) rotate(4deg); } }
@keyframes shimmer   { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
@keyframes gradientFlow { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes pulse-dot { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.5; transform:scale(.8); } }
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(249,115,22,0.4); }
  70%  { box-shadow: 0 0 0 10px rgba(249,115,22,0); }
  100% { box-shadow: 0 0 0 0 rgba(249,115,22,0); }
}
@keyframes ripple    { 0% { transform: scale(0); opacity:.6; } 100% { transform: scale(4); opacity:0; } }
@keyframes slideInLeft { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes countUp   { from { opacity:0; transform:scale(.7); } to { opacity:1; transform:scale(1); } }
@keyframes spin      { from { transform:rotate(0deg); } to { transform:rotate(360deg); } }
@keyframes blobAnim  { 0%,100% { border-radius:60% 40% 30% 70%/60% 30% 70% 40%; } 50% { border-radius:30% 60% 70% 40%/50% 60% 30% 60%; } }

/* =============================================
   LOGO COMPONENT
   ============================================= */
.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #F97316, #EF4444);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(249,115,22,0.35);
}
.logo-icon svg { width: 20px; height: 20px; }
.logo-text-wrap .logo-name {
  font-size: 20px; font-weight: 900; color: var(--text);
  letter-spacing: -0.5px; line-height: 1;
}
.logo-text-wrap .logo-sub {
  font-size: 10px; color: var(--text-muted); font-weight: 500;
  letter-spacing: 1.5px; text-transform: uppercase;
}
/* White variant */
.logo-mark.white .logo-icon { background: rgba(255,255,255,0.2); box-shadow: none; }
.logo-mark.white .logo-name { color: #fff; }
.logo-mark.white .logo-sub  { color: rgba(255,255,255,0.6); }

/* Large logo */
.logo-mark.lg .logo-icon { width: 48px; height: 48px; border-radius: 14px; }
.logo-mark.lg .logo-icon svg { width: 28px; height: 28px; }
.logo-mark.lg .logo-name { font-size: 26px; }

/* =============================================
   LAYOUT — DASHBOARD
   ============================================= */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-base);
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: #FFFFFF;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0;
  z-index: 100;
  animation: slideInLeft 0.35s ease;
  box-shadow: var(--shadow-xs);
}
.sidebar-logo {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-nav {
  flex: 1; padding: 14px 12px;
  overflow-y: auto;
}
.sidebar-section-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 12px 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  transition: var(--transition); margin-bottom: 2px;
  position: relative;
}
.sidebar-link i { width: 18px; font-size: 14px; text-align: center; flex-shrink: 0; }
.sidebar-link:hover { color: var(--primary); background: var(--primary-glow2); }
.sidebar-link.active {
  color: var(--primary); background: var(--primary-glow2);
  font-weight: 600;
}
.sidebar-link.active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.sidebar-link .badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--radius-full);
}
.sidebar-link .badge.red { background: var(--red); }
.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
}
.sidebar-user:hover { background: var(--bg-muted); }
.sidebar-user .s-avatar {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sidebar-user .name { font-size: 13px; font-weight: 600; color: var(--text); }
.sidebar-user .role { font-size: 11px; color: var(--text-muted); }

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh;
}

/* TOP HEADER */
.top-header {
  height: var(--header-height);
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px; gap: 14px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-xs);
  animation: fadeInDown 0.35s ease;
}
.header-title { font-size: 18px; font-weight: 700; color: var(--text); flex: 1; }
.header-search { flex: 1; max-width: 340px; position: relative; }
.header-search input {
  width: 100%;
  background: var(--bg-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 9px 16px 9px 40px;
  color: var(--text); font-size: 14px; outline: none;
  transition: var(--transition);
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-glow2); }
.header-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-icon-btn {
  width: 38px; height: 38px;
  background: var(--bg-muted); border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 15px;
  transition: var(--transition); position: relative;
}
.header-icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow2); }
.header-icon-btn .notif-dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px;
  background: var(--red); border-radius: 50%;
  border: 2px solid #fff;
  animation: pulse-dot 2s infinite;
}
.header-avatar {
  width: 38px; height: 38px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  cursor: pointer; border: 2px solid transparent; transition: var(--transition);
}
.header-avatar:hover { border-color: var(--primary); }

/* PAGE CONTENT */
.page-content {
  padding: 28px; flex: 1;
  animation: fadeIn 0.4s ease;
}

/* =============================================
   COMPONENTS
   ============================================= */

/* CARDS */
.card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card-title   { font-size: 16px; font-weight: 700; color: var(--text); }
.card-subtitle{ font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.card-header  {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 20px;
}

/* STAT CARDS */
.stat-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%; opacity: 0.06;
  transform: translate(20px, -20px);
}
.stat-card.orange::after { background: var(--orange); }
.stat-card.green::after  { background: var(--green); }
.stat-card.blue::after   { background: var(--blue); }
.stat-card.purple::after { background: var(--purple); }
.stat-card.red::after    { background: var(--red); }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
  width: 46px; height: 46px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 16px;
}
.stat-icon.orange { background: #FFF7ED; color: var(--orange); }
.stat-icon.green  { background: #F0FDF4; color: var(--green); }
.stat-icon.blue   { background: #EFF6FF; color: var(--blue); }
.stat-icon.purple { background: #F5F3FF; color: var(--purple); }
.stat-icon.red    { background: #FEF2F2; color: var(--red); }
.stat-icon.cyan   { background: #ECFEFF; color: var(--cyan); }

.stat-value {
  font-size: 28px; font-weight: 800;
  color: var(--text); letter-spacing: -1px;
  animation: countUp 0.5s ease;
}
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-change {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  padding: 3px 8px; border-radius: var(--radius-full);
  margin-top: 10px;
}
.stat-change.up   { background: #F0FDF4; color: var(--green); }
.stat-change.down { background: #FEF2F2; color: var(--red); }
.stat-change.neutral { background: var(--bg-muted); color: var(--text-muted); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600;
  border: none; outline: none;
  transition: var(--transition);
  cursor: pointer; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #F97316, #EF4444);
  color: #fff;
  box-shadow: 0 4px 14px rgba(249,115,22,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(249,115,22,0.4);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--primary-glow2);
  color: var(--primary);
  border: 1.5px solid var(--primary-light);
}
.btn-secondary:hover { background: var(--primary-light); }
.btn-ghost {
  background: #fff; border: 1.5px solid var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow2); }
.btn-muted {
  background: var(--bg-muted); border: 1.5px solid var(--border);
  color: var(--text-dim);
}
.btn-muted:hover { background: var(--border); color: var(--text); }
.btn-danger {
  background: #FEF2F2; border: 1.5px solid #FECACA;
  color: var(--red);
}
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-success {
  background: #F0FDF4; border: 1.5px solid #BBF7D0;
  color: var(--green);
}
.btn-success:hover { background: var(--green); color: #fff; }
.btn-sm  { padding: 7px 14px; font-size: 13px; }
.btn-xs  { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg  { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-xl  { padding: 17px 36px; font-size: 17px; border-radius: var(--radius-xl); font-weight: 700; }

/* TAGS / BADGES */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
}
.tag-orange { background: #FFF7ED; color: var(--orange); border: 1px solid #FED7AA; }
.tag-green  { background: #F0FDF4; color: var(--green);  border: 1px solid #BBF7D0; }
.tag-blue   { background: #EFF6FF; color: var(--blue);   border: 1px solid #BFDBFE; }
.tag-purple { background: #F5F3FF; color: var(--purple); border: 1px solid #DDD6FE; }
.tag-red    { background: #FEF2F2; color: var(--red);    border: 1px solid #FECACA; }
.tag-yellow { background: #FFFBEB; color: var(--yellow); border: 1px solid #FDE68A; }
.tag-gray   { background: var(--bg-muted); color: var(--text-muted); border: 1px solid var(--border); }

/* AVATAR */
.avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; border-radius: var(--radius-full); flex-shrink: 0;
  color: #fff;
}
.avatar-sm  { width: 32px; height: 32px; font-size: 12px; }
.avatar-md  { width: 44px; height: 44px; font-size: 16px; }
.avatar-lg  { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl  { width: 80px; height: 80px; font-size: 28px; }

/* FORMS */
.form-group  { margin-bottom: 18px; }
.form-label  {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-dim); margin-bottom: 7px; letter-spacing: 0.2px;
}
.form-input {
  width: 100%;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px; color: var(--text);
  font-size: 14px; outline: none; transition: var(--transition);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow2); }
.form-select {
  width: 100%;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px; color: var(--text);
  font-size: 14px; outline: none; transition: var(--transition);
  appearance: none; cursor: pointer;
}
.form-select:focus { border-color: var(--primary); }
.form-textarea { min-height: 96px; resize: vertical; }

/* TABLE */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 11px 16px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1.5px solid var(--border);
  background: var(--bg-muted);
  white-space: nowrap;
}
.data-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.data-table td {
  padding: 14px 16px; font-size: 14px;
  color: var(--text-dim); border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover td { background: #FAFAFA; }
.data-table tr:last-child td { border-bottom: none; }

/* GRID */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }

/* PROGRESS BAR */
.progress-bar-wrap {
  background: var(--bg-muted); border-radius: var(--radius-full);
  overflow: hidden; height: 6px;
}
.progress-bar-fill {
  height: 100%; border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), #EF4444);
  transition: width 1s ease;
}

/* DIVIDER */
.divider { border: none; border-top: 1.5px solid var(--border); margin: 20px 0; }

/* TOGGLE SWITCH */
.toggle-switch {
  width: 44px; height: 24px; border-radius: var(--radius-full);
  background: var(--border); position: relative;
  transition: var(--transition); cursor: pointer; border: none; outline: none;
}
.toggle-switch::after {
  content: ''; position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%; background: #fff;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}
.toggle-switch.on { background: var(--primary); }
.toggle-switch.on::after { left: 23px; }

/* TOAST */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.35s ease;
  z-index: 9999; max-width: 340px;
}
.toast i { font-size: 18px; flex-shrink: 0; }
.toast .toast-text { font-size: 14px; font-weight: 600; color: var(--text); }
.toast .toast-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* MODAL */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(6px);
  z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius-xl); padding: 36px;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.3s ease;
}

/* EMPTY STATE */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 48px; color: var(--text-light); margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text-dim); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; color: var(--text-muted); }

/* =============================================
   ANIMATION UTILITY CLASSES
   ============================================= */
.animate-fade-in    { animation: fadeIn 0.4s ease both; }
.animate-fade-up    { animation: fadeInUp 0.45s ease both; }
.animate-fade-left  { animation: fadeInLeft 0.45s ease both; }
.animate-fade-right { animation: fadeInRight 0.45s ease both; }
.animate-float      { animation: float 4s ease-in-out infinite; }
.animate-float-slow { animation: floatSlow 6s ease-in-out infinite; }

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }
.delay-5 { animation-delay: 0.40s; }
.delay-6 { animation-delay: 0.48s; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .top-header { padding: 0 16px; }
  .header-search { display: none; }
}

/* =============================================
   SHARED LOGO HTML HELPER
   (included via JS snippet in all pages)
   ============================================= */
.logo-svg-icon {
  fill: none;
}
