/* =============================================================================
   PiposX Design System
   Phase 1 — UI Modernization (Plan 01-01)
   Single source of truth for all design tokens across the platform.
   All subsequent plans reference these token names by exact spelling.
   ============================================================================= */

/* SECTION 1 — Google Fonts import and :root token block */

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

:root {
  /* Typography — DESIGN-01, DESIGN-03 */
  --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --text-display: clamp(2.5rem, 5vw, 4rem);
  --text-h1: clamp(1.75rem, 3vw, 2.5rem);
  --text-h2: clamp(1.5rem, 2.5vw, 2rem);
  --text-h3: clamp(1.25rem, 2vw, 1.5rem);
  --text-body: 1rem;
  --text-small: 0.875rem;
  --text-xs: 0.75rem;

  /* Brand Colors — DESIGN-04 (from tailwind.config.js — DO NOT ALTER VALUES) */
  --color-primary: #3b82f6;
  --color-primary-dark: #2563eb;
  --color-primary-light: #60a5fa;
  --color-secondary: #64748b;
  --color-accent: #d946ef;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-surface: #ffffff;
  --color-surface-alt: #f8fafc;
  --color-text: #1e293b;
  --color-text-muted: #64748b;

  /* Spacing — DESIGN-02 */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius — DESIGN-02 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-card: 1rem;      /* 16px per COMP-01 */
  --radius-pill: 9999px;    /* buttons per COMP-02 */
  --radius-avatar: 50%;

  /* Shadows — DESIGN-02 */
  --shadow-card: 0 2px 15px -3px rgba(0,0,0,0.07), 0 10px 20px -2px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 8px 30px -5px rgba(0,0,0,0.12), 0 12px 24px -4px rgba(0,0,0,0.08);
  --shadow-nav: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-btn: 0 2px 8px rgba(59,130,246,0.3);

  /* Transitions — DESIGN-02 */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* SECTION 2 — Global font application (DESIGN-01)
   Apply Poppins across all elements that Bootstrap or the existing theme
   would otherwise render with a system font. */

body,
.navbar,
h1, h2, h3, h4, h5, h6,
p, a, span, li, td, th,
input, textarea, select, label, button {
  font-family: var(--font-primary) !important;
}

/* SECTION 3 — Active nav indicator base styles (COMP-05)
   The active CSS class is applied server-side by BaseMasterPage.cs.
   These rules provide the underline scaleX slide visual. */

/* Active nav indicator — COMP-05 */
.navbar-nav > li > a {
  position: relative;
  transition: color var(--transition-fast);
}
.navbar-nav > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  right: 50%;
  height: 2px;
  background: var(--color-primary);
  transition: left var(--transition-base), right var(--transition-base);
}
.navbar-nav > li.active > a::after,
.navbar-nav > li > a:hover::after {
  left: 10%;
  right: 10%;
}
.navbar-nav > li.active > a {
  color: var(--color-primary) !important;
  font-weight: 600;
}

/* =============================================================================
   SECTION 4 — Component Rules (Plan 01-02)
   COMP-01 through COMP-08: Cards, Buttons, Forms, Nav, Avatars, Toasts, Skeleton
   ============================================================================= */

/* COMP-01: Card/panel uplift — 16px rounded corners, shadow, hover lift */
.panel, .well, .post, .post-box, .content-box,
.list-group-item.post-item, .card-piposx {
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-card);
  border: none !important;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.panel:hover, .post:hover, .card-piposx:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

/* COMP-02: Pill buttons — pill shape, hover scale, ripple */
.btn-primary, .btn-primary:focus {
  border-radius: var(--radius-pill) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-btn);
}
/* Ripple effect — JS adds .ripple span on click */
.btn-primary .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple-anim 0.5s linear;
  background: rgba(255,255,255,0.35);
}
@keyframes ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* COMP-03: Floating labels (CSS-only) */
/* Apply .floating-label-group to a wrapper div containing input then label in DOM order */
/* IMPORTANT: input must appear BEFORE label in the DOM for :placeholder-shown + ~ selector to work */
/* Page-specific plans (04, 05, 06) will apply this class where form markup order permits */
.floating-label-group {
  position: relative;
  margin-bottom: var(--space-lg);
}
.floating-label-group input,
.floating-label-group textarea {
  padding-top: 1.375rem;
  padding-bottom: 0.375rem;
}
.floating-label-group label {
  position: absolute;
  top: 0.875rem;
  left: 0.875rem;
  font-size: var(--text-small);
  color: var(--color-text-muted);
  pointer-events: none;
  transition: top var(--transition-fast), font-size var(--transition-fast), color var(--transition-fast);
  margin: 0;
}
.floating-label-group input:not(:placeholder-shown) ~ label,
.floating-label-group input:focus ~ label,
.floating-label-group textarea:not(:placeholder-shown) ~ label,
.floating-label-group textarea:focus ~ label {
  top: 0.25rem;
  font-size: var(--text-xs);
  color: var(--color-primary);
}
/* Error state — COMP-03 */
.floating-label-group.has-error input {
  border-color: var(--color-danger) !important;
  animation: shake 0.4s ease;
}
.floating-label-group.has-error label { color: var(--color-danger); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
/* Success state — COMP-03 */
.floating-label-group.has-success input {
  border-color: var(--color-success) !important;
}
.floating-label-group.has-success::after {
  content: '\2713';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-success);
  font-weight: 700;
}

/* COMP-04: Sticky nav glassmorphism — backdrop-filter blur */
.navbar-fixed-top,
.navbar-fixed-top.menu {
  background: rgba(255,255,255,0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-nav);
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

/* COMP-06: Circular avatars with brand border and pulsing online indicator */
img.avatar,
.profile-img img,
.friend-img img,
.user-avatar img {
  border-radius: var(--radius-avatar) !important;
  border: 2px solid var(--color-primary) !important;
  object-fit: cover;
}
/* Online indicator — wrap img in .avatar-wrap for the dot */
.avatar-wrap {
  position: relative;
  display: inline-block;
}
.avatar-wrap.online::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--color-success);
  border-radius: 50%;
  border: 2px solid #fff;
  animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* COMP-07: Toast notifications — slide-in from top-right, color-coded, auto-dismiss progress bar */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.piposx-toast {
  display: flex;
  flex-direction: column;
  min-width: 280px;
  max-width: 380px;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  background: #fff;
  border-left: 4px solid var(--color-primary);
  opacity: 0;
  transform: translateX(calc(100% + 1rem));
  transition: opacity var(--transition-base), transform var(--transition-base);
  pointer-events: auto;
  font-family: var(--font-primary);
  font-size: var(--text-small);
}
.piposx-toast.visible {
  opacity: 1;
  transform: translateX(0);
}
.piposx-toast--success { border-left-color: var(--color-success); }
.piposx-toast--error   { border-left-color: var(--color-danger); }
.piposx-toast--info    { border-left-color: var(--color-primary); }
.toast-progress {
  height: 3px;
  border-radius: 2px;
  background: var(--color-primary);
  margin-top: var(--space-sm);
  animation: toast-progress-bar 4s linear forwards;
}
.piposx-toast--success .toast-progress { background: var(--color-success); }
.piposx-toast--error   .toast-progress { background: var(--color-danger); }
@keyframes toast-progress-bar {
  from { width: 100%; }
  to   { width: 0%; }
}

/* COMP-08: Skeleton shimmer — for profile images and content loading states */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position:   0% 50%; }
}

/* Responsive safeguard — mobile toast baseline */
@media (max-width: 375px) {
  #toast-container {
    left: 0.5rem;
    right: 0.5rem;
    top: 0.5rem;
  }
  .piposx-toast {
    min-width: unset;
    max-width: 100%;
    transform: translateY(-120%);
  }
  .piposx-toast.visible {
    transform: translateY(0);
  }
}

/* =============================================================================
   SECTION 5 — App-wide Page Chrome & Component Overrides
   Targets the concrete HTML structure of Main.Master pages to deliver a
   modern, clean visual without touching any server-side code.
   ============================================================================= */

/* ── Page background ── */
body:not(.mobile-mode) {
  background: #f1f5f9 !important;
}

/* ── Main content wrapper — push below fixed navbar ── */
#page-contents {
  padding-top: 80px;
  padding-bottom: 2rem;
}

/* ── Nav bar improvements ── */
.navbar-fixed-top .navbar-brand img {
  max-height: 36px;
}
.navbar-fixed-top .navbar-nav > li > a {
  color: var(--color-text) !important;
  font-weight: 500;
  font-size: 0.875rem;
  padding-top: 22px;
  padding-bottom: 22px;
}
.navbar-fixed-top .navbar-nav > li.active > a {
  color: var(--color-primary) !important;
}
/* Search input in nav */
.navbar .search-threads {
  background: rgba(241,245,249,0.9) !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: var(--radius-pill) !important;
  color: var(--color-text) !important;
  padding-left: 2.25rem !important;
  height: 38px !important;
  font-size: 0.875rem !important;
  transition: border-color 0.18s, box-shadow 0.18s !important;
}
.navbar .search-threads:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12) !important;
  background: #fff !important;
  outline: none !important;
}

/* ── Left sidebar: profile card & nav ── */
.col-md-2.static .profile-card {
  background: var(--color-surface) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-card) !important;
  border: none !important;
  padding: 1.25rem 1rem !important;
  margin-bottom: 1rem;
}
.col-md-2.static .profile-card .profile-desc h5 {
  font-size: 0.85rem !important;
  margin: 0.2rem 0 !important;
  font-weight: 600 !important;
}
.col-md-2.static .profile-card .profile-desc a.text-white {
  color: var(--color-text) !important;
}
.col-md-2.static .profile-card .profile-desc a.text-white:hover {
  color: var(--color-primary) !important;
}
.col-md-2.static .profile-card img {
  border-radius: 50% !important;
  border: 3px solid var(--color-primary) !important;
  width: 56px !important;
  height: 56px !important;
  object-fit: cover !important;
}

/* Sidebar nav */
.setting-list {
  background: var(--color-surface) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-card) !important;
  padding: 0.5rem 0 !important;
  margin-bottom: 1rem;
}
.nav-news-feed {
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
}
.nav-news-feed li {
  display: flex !important;
  align-items: center !important;
  padding: 0.625rem 1rem !important;
  border-radius: 0 !important;
  transition: background 0.15s !important;
  cursor: pointer;
  position: relative;
}
.nav-news-feed li:hover {
  background: #f8fafc !important;
}
.nav-news-feed li .icon {
  font-size: 1.1rem !important;
  color: var(--color-primary) !important;
  width: 24px !important;
  flex-shrink: 0 !important;
}
.nav-news-feed li div a {
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  color: var(--color-text) !important;
  text-decoration: none !important;
  display: block;
  line-height: 1.4;
}
.nav-news-feed li div a:hover { color: var(--color-primary) !important; }
.nav-news-feed li .unread_count {
  position: static !important;
  margin-left: auto !important;
  background: var(--color-primary) !important;
  color: white !important;
  border-radius: var(--radius-pill) !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  padding: 0.1rem 0.45rem !important;
  min-width: 20px;
  text-align: center;
  line-height: 1.5;
}

/* ── Create post box ── */
.create-main {
  margin-bottom: 1rem;
}
.create-post {
  background: var(--color-surface) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-card) !important;
  border: none !important;
  padding: 1.125rem 1.25rem !important;
}
.create-area {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}
.create-area .form-group {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
  margin-bottom: 0.5rem !important;
}
.create-area .form-group img,
.create-area .form-group .profile-photo-md {
  border-radius: 50% !important;
  border: 2px solid var(--color-primary) !important;
  flex-shrink: 0 !important;
}
/* Post textarea */
.create-post .news_post,
.create-post .hwt-content {
  border: 1.5px solid #e2e8f0 !important;
  border-radius: var(--radius-lg) !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.9rem !important;
  font-family: var(--font-primary) !important;
  color: var(--color-text) !important;
  background: #f8fafc !important;
  resize: none !important;
  transition: border-color 0.18s, box-shadow 0.18s !important;
  width: 100% !important;
}
.create-post .news_post:focus,
.create-post .hwt-content:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1) !important;
  background: #fff !important;
  outline: none !important;
}
/* Post tools bar */
.create-post .post-tools {
  border-top: 1px solid #f1f5f9 !important;
  padding-top: 0.75rem !important;
  margin-top: 0.5rem !important;
}
.create-post .btn-publish {
  background: linear-gradient(135deg, var(--color-primary), #7c3aed) !important;
  border: none !important;
  border-radius: var(--radius-pill) !important;
  padding: 0.5rem 1.5rem !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3) !important;
  color: white !important;
  transition: opacity 0.18s, transform 0.15s !important;
}
.create-post .btn-publish:hover {
  opacity: 0.9 !important;
  transform: translateY(-1px) !important;
}
/* Audience selector */
.create-post .select-aud .btn {
  border-radius: var(--radius-pill) !important;
  font-size: 0.8rem !important;
  padding: 0.4rem 0.9rem !important;
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  color: var(--color-text) !important;
}

/* ── Post cards ── */
.post-content.post {
  background: var(--color-surface) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-card) !important;
  border: none !important;
  margin-bottom: 1rem !important;
  padding: 1.25rem !important;
  overflow: hidden;
}
.post-content.post:hover {
  transform: translateY(-1px) !important;
  box-shadow: var(--shadow-card-hover) !important;
}
.post-content .post-container {
  border: none !important;
  background: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
/* Post header: avatar + name + time */
.post-content .post-detail {
  position: relative !important;
  padding: 0 !important;
}
.post-content .post-detail .user-info h5 {
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  margin: 0 0 0.1rem !important;
  color: var(--color-text) !important;
}
.post-content .post-detail .user-info p.text-muted {
  font-size: 0.75rem !important;
  color: var(--color-text-muted) !important;
  margin: 0 !important;
}
.post-content .post-detail .profile-link {
  color: var(--color-text) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}
.post-content .post-detail .profile-link:hover {
  color: var(--color-primary) !important;
}
/* Post scope badge */
.post-content .postScope {
  font-size: 0.72rem !important;
  border-radius: var(--radius-pill) !important;
  padding: 0.15rem 0.6rem !important;
  display: inline-block !important;
  margin-bottom: 0.5rem !important;
  color: var(--color-text-muted) !important;
}
.post-content .postScope a {
  color: var(--color-primary) !important;
  font-weight: 500 !important;
  text-decoration: none !important;
}
/* Post body text */
.post-content .post-text,
.post-content .thread_post_text {
  font-size: 0.925rem !important;
  color: var(--color-text) !important;
  line-height: 1.65 !important;
  margin: 0.5rem 0 !important;
}
/* Post actions (like, comment, share) */
.post-content .reaction,
.post-content .post-actions {
  border-top: 1px solid #f1f5f9 !important;
  padding-top: 0.75rem !important;
  margin-top: 0.75rem !important;
}
/* Comments */
.post-content .post-comment {
  border-top: 1px solid #f1f5f9 !important;
  padding-top: 0.75rem !important;
  margin-top: 0.5rem !important;
}
.post-content .post-comment .form-control {
  border-radius: var(--radius-pill) !important;
  border: 1.5px solid #e2e8f0 !important;
  font-size: 0.85rem !important;
  height: 40px !important;
  padding: 0 1rem !important;
  background: #f8fafc !important;
  transition: border-color 0.18s, box-shadow 0.18s !important;
}
.post-content .post-comment .form-control:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1) !important;
  background: #fff !important;
  outline: none !important;
}

/* Load More button */
#btnLoadMore {
  border-radius: var(--radius-pill) !important;
  padding: 0.625rem 2rem !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  background: var(--color-surface) !important;
  color: var(--color-primary) !important;
  border: 2px solid var(--color-primary) !important;
  transition: background 0.18s, color 0.18s !important;
}
#btnLoadMore:hover {
  background: var(--color-primary) !important;
  color: white !important;
}

/* ── Right sidebar improvements ── */
.col-md-3.static .suggestions {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
.col-md-3.static .panel {
  background: var(--color-surface) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-card) !important;
  border: none !important;
  padding: 1rem !important;
  margin-bottom: 1rem;
}
.col-md-3.static .panel-heading {
  background: none !important;
  border: none !important;
  padding: 0 0 0.5rem !important;
  font-weight: 600 !important;
  color: var(--color-text) !important;
  font-size: 0.875rem !important;
}

/* ── Profile photo sizes ── */
.profile-photo-md {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}
.profile-photo {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

/* ── Fade-in animation for Load More ── */
.post-card-new {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.post-card-new.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Mobile nav sidebar ── */
@media (max-width: 767px) {
  #page-contents {
    padding-top: 60px;
  }
  .post-content.post {
    margin-bottom: 0.75rem !important;
    padding: 1rem !important;
    border-radius: 0.875rem !important;
  }
}

/* ============================================================
   SECTION 5 — Bootstrap-Free Layout Utilities
   Loaded on ALL master pages. Replaces Bootstrap 3 classes
   so every page works after Bootstrap removal.
   ============================================================ */

/* Visibility */
.hide { display: none !important; }
.show { display: block !important; }

/* Float helpers */
.pull-right { float: right !important; }
.pull-left  { float: left  !important; }

/* Clearfix */
.clearfix::after { content: ""; display: table; clear: both; }

/* Container */
.container {
    display: block;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
    width: 100%;
}

/* Row */
.row {
    margin-left: -10px;
    margin-right: -10px;
    box-sizing: border-box;
}
.row::after { content: ""; display: table; clear: both; }

/* Column grid */
[class*="col-"] {
    float: left;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
    min-height: 1px;
    position: relative;
}
.col-md-1  { width: 8.333%;  }
.col-md-2  { width: 16.667%; }
.col-md-3  { width: 25%;     }
.col-md-4  { width: 33.333%; }
.col-md-5  { width: 41.667%; }
.col-md-6  { width: 50%;     }
.col-md-7  { width: 58.333%; }
.col-md-8  { width: 66.667%; }
.col-md-9  { width: 75%;     }
.col-md-10 { width: 83.333%; }
.col-md-11 { width: 91.667%; }
.col-md-12 { width: 100%; float: none; }
.col-sm-2  { width: 16.667%; }
.col-sm-3  { width: 25%;     }
.col-sm-4  { width: 33.333%; }
.col-sm-6  { width: 50%;     }
.col-sm-8  { width: 66.667%; }
.col-sm-10 { width: 83.333%; }
.col-sm-12 { width: 100%; float: none; }
.col-xs-6  { width: 50%;     }
.col-xs-12 { width: 100%; float: none; }
@media (max-width: 767px) {
    [class*="col-"] { float: none; width: 100%; }
}

/* Bootstrap responsive visibility */
.hidden-xs { display: block; }
@media (max-width: 767px) { .hidden-xs { display: none !important; } }

.hidden-sm { display: block; }
@media (min-width: 768px) and (max-width: 991px) { .hidden-sm { display: none !important; } }

.hidden-md { display: block; }
@media (min-width: 992px) and (max-width: 1199px) { .hidden-md { display: none !important; } }

.hidden-lg { display: block; }
@media (min-width: 1200px) { .hidden-lg { display: none !important; } }

@media (max-width: 767px) { .visible-xs-block { display: block !important; } }
@media (min-width: 768px) and (max-width: 991px) { .visible-sm-block { display: block !important; } }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
    text-decoration: none !important;
    white-space: nowrap;
    line-height: 1.4;
    font-family: inherit;
    background: transparent;
    color: #374151;
    box-sizing: border-box;
}
.btn:focus { outline: none; }
.btn-primary {
    background: #3b82f6 !important;
    color: #fff !important;
    border-color: #3b82f6 !important;
}
.btn-primary:hover { background: #2563eb !important; border-color: #2563eb !important; }
.btn-default, .btn-secondary {
    background: #fff !important;
    color: #374151 !important;
    border-color: #d1d5db !important;
}
.btn-default:hover, .btn-secondary:hover { background: #f9fafb !important; }
.btn-danger  { background: #ef4444 !important; color: #fff !important; border-color: #ef4444 !important; }
.btn-success { background: #22c55e !important; color: #fff !important; border-color: #22c55e !important; }
.btn-sm  { padding: 3px 10px  !important; font-size: 12px !important; }
.btn-xs  { padding: 2px 8px   !important; font-size: 11px !important; }
.btn-block { display: block !important; width: 100% !important; }

/* Form controls */
.form-group { margin-bottom: 12px; }
.form-control {
    display: block;
    width: 100%;
    height: 34px;
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    line-height: 1.42;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
textarea.form-control { height: auto; resize: vertical; }
select.form-control   { height: 34px; }

/* Input group */
.input-group { display: flex; align-items: stretch; position: relative; width: 100%; }
.input-group .form-control { flex: 1; border-radius: 0; }
.input-group .form-control:first-child { border-radius: 6px 0 0 6px; }
.input-group .form-control:last-child  { border-radius: 0 6px 6px 0; }
.input-group-btn { display: flex; }
.input-group-btn .btn:last-child { border-radius: 0 6px 6px 0; }

/* Text utilities */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-left    { text-align: left; }
.text-muted   { color: #94a3b8 !important; }
.text-primary { color: #3b82f6 !important; }
.text-danger  { color: #ef4444 !important; }
.text-success { color: #22c55e !important; }
.text-warning { color: #b45309 !important; }

/* List utilities */
.list-inline { list-style: none; padding: 0; margin: 0; }
.list-inline > li { display: inline-block; padding-left: 4px; padding-right: 4px; }
.list-unstyled { list-style: none; padding: 0; margin: 0; }

/* Image utilities */
.img-responsive { display: block; max-width: 100%; height: auto; }
.img-circle { border-radius: 50%; }

/* Panel */
.panel {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.panel-heading {
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 10px 10px 0 0;
}
.panel-title { font-size: 14px; font-weight: 600; margin: 0; }
.panel-body { padding: 15px; }
.panel-footer { padding: 10px 16px; border-top: 1px solid #e2e8f0; border-radius: 0 0 10px 10px; }

/* Well */
.well { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin-bottom: 12px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 12px; border: 1px solid transparent; font-size: 13px; }
.alert-info    { background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.2); color: #1d4ed8; }
.alert-success { background: rgba(34,197,94,.08);  border-color: rgba(34,197,94,.2);  color: #15803d; }
.alert-warning { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.2); color: #b45309; }
.alert-danger  { background: rgba(239,68,68,.08);  border-color: rgba(239,68,68,.2);  color: #dc2626; }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.table thead th { font-weight: 600; background: #f8fafc; border-bottom-width: 2px; }
.table-hover tbody tr:hover { background: #f9fafb; }
.table-striped tbody tr:nth-of-type(odd) { background: #f9fafb; }
.table-bordered { border: 1px solid #e2e8f0; }
.table-bordered th, .table-bordered td { border: 1px solid #e2e8f0; }
.table-condensed th, .table-condensed td { padding: 4px 8px; }

/* Badge / label */
.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: #3b82f6;
    color: #fff;
    line-height: 1.4;
}
.label { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; line-height: 1.4; }
.label-default { background: #e2e8f0; color: #475569; }
.label-primary  { background: rgba(59,130,246,.12); color: #3b82f6; }
.label-success  { background: rgba(34,197,94,.12);  color: #16a34a; }
.label-warning  { background: rgba(245,158,11,.12); color: #b45309; }
.label-danger   { background: rgba(239,68,68,.12);  color: #dc2626; }

/* Thumbnail */
.thumbnail { display: block; border: 1px solid #e2e8f0; border-radius: 8px; padding: 4px; }

/* Dropdown */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 9999;
    min-width: 140px;
    padding: 4px 0;
    list-style: none;
    margin: 2px 0 0;
}
.dropdown.open > .dropdown-menu { display: block; }
.dropdown-menu > li > a {
    display: block;
    padding: 7px 14px;
    font-size: 12px;
    color: #475569;
    text-decoration: none;
    white-space: nowrap;
    transition: background .1s;
}
.dropdown-menu > li > a:hover { background: rgba(59,130,246,.05); color: #3b82f6; }
.dropdown-menu > li > span    { display: block; padding: 3px 14px; font-size: 10px; color: #94a3b8; }
.dropdown-header {
    display: block;
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.caret {
    display: inline-block;
    width: 0; height: 0;
    margin-left: 4px;
    vertical-align: middle;
    border-top: 4px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

/* Navbar helpers */
.navbar-fixed-top { position: fixed; top: 0; left: 0; right: 0; z-index: 1030; }
.navbar-toggle { display: none; background: none; border: 1px solid #d1d5db; border-radius: 4px; padding: 6px 10px; cursor: pointer; }
.navbar-collapse { }
.navbar-header { float: left; }

/* Nav tabs */
.nav-tabs { display: flex; list-style: none; padding: 0; margin: 0; border-bottom: 2px solid #e2e8f0; }
.nav-tabs > li > a {
    display: block; padding: 8px 16px; font-size: 13px; font-weight: 500;
    color: #475569; text-decoration: none; border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s; margin-bottom: -2px;
}
.nav-tabs > li.active > a, .nav-tabs > li > a:hover { color: #3b82f6; border-bottom-color: #3b82f6; }

/* Positioning helper used on sidebar columns */
.static { position: static !important; }

/* Misc */
fieldset { border: none; margin: 0; padding: 0; }
fieldset.form-group { margin-bottom: 12px; }
.checkbox, .radio { margin: 4px 0 8px; }

/* ── Image upload / crop widget (profile-image-body template) ────────────── */
.upload-demo .upload-demo-wrap,
.upload-demo .upload-result,
.upload-demo.ready .upload-msg { display: none; }
.upload-demo.ready .upload-demo-wrap { display: block; }
.upload-demo.ready .upload-result { display: inline-block; }
.upload-demo-wrap { width: 300px; height: 300px; margin: 0 auto; }
.upload-msg {
    text-align: center; padding: 50px; font-size: 22px; color: #aaa;
    width: 260px; margin: 50px auto; border: 1px solid #aaa;
}
.file-btn {
    position: relative; background: #27aae1; padding: 5px 25px;
    border: none; font-size: 14px; border-radius: 30px;
    color: #fff; font-weight: 600; outline: none; cursor: pointer;
}
.file-btn:hover { background: #149AC9; transition: all 1s; }
.file-btn input[type="file"] {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; opacity: 0;
}
.checkbox label, .radio label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; font-weight: normal; }
