/* ==========================================================================
   UNICORP AUTO PAINTS - Automotive Paint Mixing & Shop Management System
   Brand Color Scheme: Unicorp Blue (#1877F2), Clean White Workspace, Crisp Modern SaaS
   ========================================================================== */

:root {
  --primary: #1877F2;
  --primary-rgb: 24, 119, 242;
  --primary-hover: #1464cc;
  --primary-light: #ebf5ff;
  --secondary: #1E293B;
  --secondary-rgb: 30, 41, 59;
  --accent: #1877F2;
  --accent-rgb: 24, 119, 242;
  --accent-hover: #1464cc;
  --accent-light: #eaf3ff;
  --bg-main: #F4F7FB;
  --card-bg: #FFFFFF;
  --border-color: #E2E8F0;
  --border-light: #EDF2F7;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 76px;
  --topnav-height: 64px;
  
  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --info: #0284C7;
  --info-bg: #F0F9FF;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 0.925rem;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}
a:hover {
  color: var(--primary-hover);
}

/* Base Layout Container */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar Styles - Clean White SaaS Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: #FFFFFF;
  color: #334155;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1020;
  border-right: 1px solid var(--border-color);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
}

.sidebar-brand {
  height: var(--topnav-height);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

.brand-logo-img {
  max-height: 38px;
  width: auto;
  object-fit: contain;
}

.sidebar-nav-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.sidebar-nav-container::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.nav-section-title {
  padding: 1.25rem 0.9rem 0.45rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.2px;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav .nav-item {
  margin-bottom: 4px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 0.68rem 0.9rem;
  color: #334155;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: all 0.15s ease;
  position: relative;
}

.sidebar-nav .nav-link i {
  font-size: 1.15rem;
  margin-right: 0.85rem;
  width: 20px;
  text-align: center;
  color: #64748b;
  transition: color 0.15s ease;
}

.sidebar-nav .nav-link:hover {
  color: var(--primary);
  background-color: #f8fafc;
}
.sidebar-nav .nav-link:hover i {
  color: var(--primary);
}

/* Active Navigation Item - Vibrant Blue Rounded Pill */
.sidebar-nav .nav-item.active > .nav-link,
.sidebar-nav .nav-link.active {
  color: #FFFFFF !important;
  background-color: var(--primary) !important;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(24, 119, 242, 0.25);
}

.sidebar-nav .nav-item.active > .nav-link i,
.sidebar-nav .nav-link.active i {
  color: #FFFFFF !important;
}

.nav-arrow {
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  color: #94a3b8;
}

.nav-link.active .nav-arrow {
  color: #FFFFFF;
}

.nav-link[aria-expanded="true"] .nav-arrow {
  transform: rotate(90deg);
}

.sidebar-submenu {
  list-style: none;
  padding: 0.35rem 0 0.35rem 2.5rem;
  background-color: transparent;
}

.sidebar-submenu .submenu-link {
  display: block;
  padding: 0.42rem 0.5rem;
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 500;
  transition: color 0.15s ease;
  position: relative;
  border-radius: var(--radius-sm);
}

.sidebar-submenu .submenu-link::before {
  content: "•";
  position: absolute;
  left: -0.75rem;
  color: #cbd5e1;
}

.sidebar-submenu .submenu-link:hover,
.sidebar-submenu .submenu-link.active {
  color: var(--primary);
  background-color: #f1f5f9;
}

.sidebar-submenu .submenu-link.active {
  font-weight: 700;
}

.sidebar-submenu .submenu-link.active::before {
  color: var(--primary);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.85rem 1rem;
  background-color: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow: hidden;
}

.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-meta {
  line-height: 1.25;
  overflow: hidden;
}

.user-name {
  color: #1e293b;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  color: #64748b;
  font-size: 0.72rem;
  white-space: nowrap;
}

/* Main Content Area */
.app-main {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease, width 0.25s ease;
}

/* Top Navigation Bar */
.app-topnav {
  height: var(--topnav-height);
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1010;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.topnav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-sidebar-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sidebar-toggle:hover {
  background-color: var(--bg-main);
  color: var(--primary);
}

.topnav-breadcrumbs {
  font-size: 0.84rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.topnav-breadcrumbs a {
  color: #64748b;
  font-weight: 500;
}
.topnav-breadcrumbs a:hover {
  color: var(--primary);
}
.topnav-breadcrumbs .current {
  color: #1e293b;
  font-weight: 600;
}

.topnav-search {
  position: relative;
  width: 300px;
}

.topnav-search input {
  width: 100%;
  padding: 0.45rem 0.85rem 0.45rem 2.2rem;
  font-size: 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background-color: #f8fafc;
  transition: all 0.2s ease;
}

.topnav-search input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.15);
}

.topnav-search i {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Storefront & Super Admin Pills */
.btn-storefront-pill {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: #334155;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}
.btn-storefront-pill:hover {
  background-color: #f8fafc;
  color: var(--primary);
  border-color: #cbd5e1;
}

.user-status-pill {
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 0.38rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}
.user-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  display: inline-block;
}

/* Primary Action Button (Blue) */
.btn-primary-action {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(24, 119, 242, 0.25);
}
.btn-primary-action:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.icon-btn-wrapper {
  position: relative;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.icon-btn:hover {
  color: var(--primary);
  background-color: var(--bg-main);
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

/* Page Content Body */
.page-body {
  flex: 1;
  padding: 1.75rem;
}

/* Page Header component */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.3px;
}

.page-header-desc {
  color: #64748b;
  font-size: 0.88rem;
  margin: 0.25rem 0 0;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Card System */
.dash-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.dash-card:hover {
  box-shadow: var(--shadow-md);
}

.dash-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.dash-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-card-body {
  padding: 1.25rem;
}

.dash-card-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background-color: #fafbfc;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

/* Footer */
.app-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Toast Container */
.app-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
