/* Open Sketch CRM - Modern Corporate Design */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --secondary: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  --sidebar-width: 280px;
  --header-height: 72px;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  background: var(--bg-secondary);
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
}

.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

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

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.75rem;
  margin-top: 1rem;
}

.nav-section-title:first-child {
  margin-top: 0;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.9375rem;
}

.nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.nav-link i {
  width: 20px;
  text-align: center;
  font-size: 1.125rem;
}

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}

.user-profile:hover {
  background: var(--bg-tertiary);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

.user-info {
  flex: 1;
}

.user-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  display: block;
}

.user-role {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100vw - var(--sidebar-width));
  overflow-x: hidden;
}

/* Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  width: calc(100% - var(--sidebar-width));
  z-index: 90;
  backdrop-filter: blur(10px);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.search-box input {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  font-size: 0.9375rem;
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-box i {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.icon-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.icon-btn .badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

/* Notification Badge */
.notification-btn {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #EF4444;
  color: white;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  border: 2px solid var(--bg-primary);
}

/* Content Area */
.content-wrapper {
  flex: 1;
  padding: 2rem;
  padding-top: calc(var(--header-height) + 2rem);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-header-left h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumb-separator {
  color: var(--text-muted);
}

/* Cards */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

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

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-tertiary);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

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

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.primary { background: rgba(79, 70, 229, 0.1); color: var(--primary); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.stat-change {
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.9375rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.5;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
}

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

.btn-success:hover {
  background: #059669;
  box-shadow: var(--shadow);
}

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

.btn-warning:hover {
  background: #d97706;
  box-shadow: var(--shadow);
}

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

.btn-danger:hover {
  background: #dc2626;
  box-shadow: var(--shadow);
}

.btn-info {
  background: #0ea5e9;
  color: white;
}

.btn-info:hover {
  background: #0284c7;
  box-shadow: var(--shadow);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  gap: 0.375rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  min-width: 38px;
}

.btn-icon.btn-sm {
  width: 34px;
  height: 34px;
  min-width: 34px;
}

/* Button variants */
.btn-compact {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  min-width: 70px;
}

.btn-full-width {
  width: 100%;
}

.btn-vertical {
  flex-direction: column;
  padding: 0.75rem;
  font-size: 0.875rem;
  gap: 0.25rem;
}

.btn-large {
  font-size: 1.125rem;
  padding: 0.75rem 2rem;
}

.btn-fixed-height {
  height: 34px;
  padding-top: 0;
  padding-bottom: 0;
}

.btn-align-start {
  align-self: flex-start;
}

/* Button Group */
.btn-group {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-group-tight {
  display: inline-flex;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.btn-group-tight .btn {
  border-radius: 0;
  border-right: 1px solid var(--border);
}

.btn-group-tight .btn:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group-tight .btn:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
  border-right: none;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
}

.badge-primary { background: rgba(79, 70, 229, 0.1); color: var(--primary); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-secondary { background: var(--bg-tertiary); color: var(--text-secondary); }

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-control, .form-select {
  width: 100%;
  max-width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.2s;
  box-sizing: border-box;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

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

.table thead th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.table tbody td {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.table tbody tr {
  transition: background 0.2s;
}

.table tbody tr:hover {
  background: var(--bg-tertiary);
}

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  border-left: 4px solid;
  animation: slideIn 0.3s ease;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--success);
  color: var(--success);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--primary);
  color: var(--text-primary);
}

/* Document Editor Styles */
.document-title-input {
  font-size: 1.5rem;
  font-weight: 600;
  border: none;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  padding: 0.75rem 0;
  background: transparent;
}

.document-description-input {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0.5rem 0;
  resize: none;
  background: transparent;
}

.document-editor-container {
  min-height: 500px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
}

.document-settings-panel {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.alert-info-icon {
  font-size: 1.25rem;
  color: var(--primary);
  margin-top: 0.125rem;
}

.alert-info-content p {
  margin: 0.5rem 0 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Mention Dropdown */
.mention-dropdown {
  position: absolute;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  min-width: 200px;
}

.mention-dropdown-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
}

.mention-dropdown-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}

.mention-dropdown-item:hover {
  background: var(--bg-secondary);
}

.mention-dropdown-item-name {
  font-weight: 500;
}

.mention-dropdown-item-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.mobile-menu-toggle:hover {
  background: var(--bg-secondary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* Responsive Tablets (1024px and below) */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 260px;
  }
  
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
  }
  
  .content-wrapper {
    padding: 1.5rem;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .search-box {
    flex: 1;
    max-width: none;
  }
  
  .app-header {
    padding: 1rem 1.5rem;
    max-width: 100%;
    box-sizing: border-box;
    left: 0;
    width: 100%;
  }
  
  /* Page Header */
  .page-header {
    max-width: 100%;
    overflow: visible;
  }
  
  /* Cards */
  .card {
    max-width: 100%;
  }
  
  /* Grid layouts */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  /* Tables */
  .table {
    font-size: 0.875rem;
  }
  
  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
  }
  
  /* Prevent all inline grids from breaking */
  [style*="display: grid"],
  [style*="display:grid"] {
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Responsive Mobile (768px and below) */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }
  
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  * {
    max-width: 100%;
  }
  
  body {
    font-size: 14px;
  }
  
  .app-container {
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  .content-wrapper {
    padding: 1rem;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  .app-header {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    max-width: 100%;
    box-sizing: border-box;
    left: 0;
    width: 100%;
  }
  
  .search-box {
    order: 3;
    width: 100%;
    margin-top: 0.75rem;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .header-actions {
    gap: 0.5rem;
  }
  
  /* Page Header */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    max-width: 100%;
    overflow: visible;
  }
  
  .page-header-left {
    max-width: 100%;
    overflow: hidden;
  }
  
  .page-header-left h1 {
    font-size: 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .page-breadcrumb {
    font-size: 0.8125rem;
  }
  
  .page-header-right {
    width: 100%;
    max-width: 100%;
  }
  
  .btn-group {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
  }
  
  .btn-group .btn {
    flex: 1;
    min-width: 0;
  }
  
  /* Stats Grid */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 100%;
  }
  
  /* Cards */
  .card {
    border-radius: var(--radius);
    max-width: 100%;
    overflow: hidden;
  }
  
  .card-header {
    padding: 1rem;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .card-body {
    padding: 1rem;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
  }
  
  /* Forms */
  .form-group {
    margin-bottom: 1rem;
    max-width: 100%;
  }
  
  .form-control, .form-select, input, textarea {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Tables */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    width: 100%;
  }
  
  .table {
    min-width: 600px;
  }
  
  /* Buttons */
  .btn {
    padding: 0.625rem 1rem;
    word-wrap: break-word;
  }
  
  .btn-sm {
    padding: 0.5rem 0.75rem;
  }
  
  /* Sidebar */
  .sidebar {
    width: 100%;
    max-width: 280px;
  }
  
  .sidebar-nav {
    padding: 1rem;
  }
  
  /* User Profile */
  .user-info {
    display: none;
  }
  
  /* Hide some elements on mobile */
  .page-breadcrumb {
    display: none;
  }
  
  /* Force all grids to be responsive */
  [style*="display: grid"][style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
}

/* Responsive Small Mobile (480px and below) */
@media (max-width: 480px) {
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  img {
    max-width: 100%;
    height: auto;
  }
  
  h1 { 
    font-size: 1.5rem;
    word-wrap: break-word;
  }
  h2 { 
    font-size: 1.25rem;
    word-wrap: break-word;
  }
  h3 { 
    font-size: 1.125rem;
    word-wrap: break-word;
  }
  
  .content-wrapper {
    padding: 0.75rem;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  .card {
    border-radius: var(--radius-sm);
    max-width: 100%;
    overflow: hidden;
  }
  
  .card-header,
  .card-body {
    padding: 0.75rem;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
  }
  
  /* Two-column grids to single column */
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns:2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  
  [style*="display: grid"][style*="gap: 1.5rem"],
  [style*="display:grid"][style*="gap:1.5rem"] {
    gap: 1rem !important;
  }
  
  /* All grids single column */
  [style*="display: grid"],
  [style*="display:grid"] {
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
  }
  
  /* Buttons full width */
  .btn-group {
    flex-direction: column;
    max-width: 100%;
  }
  
  .btn-group .btn {
    width: 100%;
    max-width: 100%;
  }
  
  .btn {
    max-width: 100%;
    white-space: normal;
  }
  
  /* Comment forms */
  [style*="max-width: 600px"],
  [style*="max-width: 500px"],
  [style*="max-width:600px"],
  [style*="max-width:500px"] {
    max-width: 100% !important;
    width: 100% !important;
  }
  
  /* Forms */
  form {
    max-width: 100%;
    overflow-x: hidden;
  }
  
  .form-control, .form-select, input, textarea {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Tables */
  .table-responsive {
    max-width: 100%;
    overflow-x: auto;
  }
  
  .table {
    font-size: 0.75rem;
    min-width: 500px;
  }
  
  .table th,
  .table td {
    padding: 0.5rem 0.25rem;
    white-space: nowrap;
  }
  
  /* Icon buttons */
  .icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }
  
  /* Modal/Menu positioning */
  .comment-menu {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: 90vw;
    width: 90vw;
  }
  
  /* Calendar adjustments */
  .calendar-wrapper {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  
  .calendar-grid {
    max-width: 100%;
    min-width: 700px;
  }
  
  /* Flex containers */
  [style*="display: flex"],
  [style*="display:flex"] {
    max-width: 100%;
    flex-wrap: wrap;
  }
  
  /* App header */
  .app-header {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    left: 0;
    width: 100%;
  }
  
  /* Stats cards */
  .stat-card {
    max-width: 100%;
  }
  
  /* Prevent text overflow */
  p, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

/* Utilities */
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-right { text-align: right; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  background: var(--card-bg);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pagination-link:hover {
  background: var(--hover-bg);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  cursor: default;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.pagination-info {
  color: var(--text-muted);
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .card-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch !important;
  }
  
  .pagination {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .pagination-info {
    text-align: center;
    flex-direction: column !important;
    align-items: center !important;
  }
  
  .pagination-info > div {
    width: 100%;
    justify-content: center;
  }
}
