.sidebar.minimized .sidebar-footer a.btn span {
  display: none;
}
:root {
  --bg: #f5f5f5;
  --panel: #fff;
  --border: #e0e0e0;
  --text: #333333;
  --muted: #757575;
  --primary: #5d4037; /* Brown - textile color */
  --primary-light: #8b6b61;
  --primary-dark: #321911;
  --accent: #d7ccc8; /* Light brown */
  --accent-light: #f5f1ef;
  --accent-dark: #a69b97;
  --success: #2e7d32;
  --danger: #c62828;
  --warning: #f57f17;
  --info: #0277bd;
  --shadow: 0 2px 8px rgba(93, 64, 55, 0.1);
  --sidebar-bg: #4e342e; /* Dark brown */
  --sidebar-text: #f5f1ef;
  --table-header: #efebe9; /* Very light brown */
  --table-stripe: #f9f6f5;
  --table-hover: #efebe9;
  --scrollbar-bg: #efebe9;
  --scrollbar-thumb: #bcaaa4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { 
  max-width: 1200px; 
  margin: 32px auto; 
  padding: 0 16px; 
}

/* Layout with sidebar */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.2s;
}

.layout.sidebar-minimized {
  grid-template-columns: 56px 1fr;
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 16px;
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  z-index: 100;
  transition: width 0.2s, min-width 0.2s, max-width 0.2s;
  width: 240px;
  min-width: 240px;
  max-width: 240px;
}

.sidebar.minimized {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  padding-left: 8px;
  padding-right: 8px;
}


.sidebar.minimized .brand .sidebar-title-text {
  display: none;
}

.sidebar.minimized .menu a {
  justify-content: center;
  padding: 12px 4px;
  font-size: 1.1em;
}

.sidebar.minimized .menu a span {
  display: none;
}

.sidebar-header button#sidebar-minimize-btn {
  display: inline-block !important;
}

.sidebar.minimized .sidebar-footer {
  opacity: 0.5;
  pointer-events: auto;
}

.sidebar.minimized #sidebar-minimize-btn i {
  transform: rotate(180deg);
}


.sidebar .brand { 
  font-weight: 700; 
  letter-spacing: 0.5px; 
  font-size: 1.2rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
}

.sidebar .menu { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
}

.sidebar .menu a {
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar .menu a:hover { 
  background: rgba(255,255,255,0.1); 
  transform: translateX(4px);
}

.sidebar .menu a.active {
  background: rgba(255,255,255,0.15);
  border-left: 3px solid var(--accent);
}

.sidebar .sidebar-footer { 
  margin-top: auto; 
  font-size: 0.85rem;
  opacity: 0.8;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.page {
  padding: 24px;
}

/* Navigation bar */
nav {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  gap: 20px;
  align-items: center;
  box-shadow: var(--shadow);
}

nav a, nav span {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  margin: 0 10px;
  transition: all 0.2s;
  position: relative;
}

nav a:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary);
  transition: width 0.2s;
}

nav a:hover:after {
  width: 100%;
}

nav a:hover {
  color: var(--primary-dark);
}

nav .spacer { flex: 1; }

nav .btn {
  padding: 8px 16px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: linear-gradient(90deg, var(--accent-light) 0%, var(--accent) 100%);
  color: var(--primary);
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(93, 64, 55, 0.1);
  transition: all 0.2s;
}

nav .btn:hover {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

/* Dashboard grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.card:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

.card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 8px 24px rgba(93, 64, 55, 0.15);
  transform: translateY(-4px);
}

.card:hover:before {
  width: 8px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: #fff;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  text-align: left;
  color: var(--primary);
  font-weight: 600;
  background: var(--table-header);
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:nth-child(even) {
  background: var(--table-stripe);
}

tr:hover td {
  background: var(--table-hover);
}

/* Buttons and actions */
.actions { 
  display: flex; 
  gap: 10px; 
}

.primary {
  background: linear-gradient(90deg, var(--accent-light) 0%, var(--accent) 100%);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(93, 64, 55, 0.1);
  transition: all 0.2s;
}

.primary:hover {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn {
  background: linear-gradient(90deg, var(--accent-light) 0%, var(--accent) 100%);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 1px 4px rgba(93, 64, 55, 0.1);
  transition: all 0.2s;
}

.btn:hover { 
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%); 
  color: var(--primary-dark); 
  transform: translateY(-2px);
}

.btn.danger { 
  border-color: var(--danger); 
  color: var(--danger); 
  background: rgba(198, 40, 40, 0.05);
}

.btn.danger:hover { 
  color: #b71c1c; 
  background: rgba(198, 40, 40, 0.1);
}

.btn.success { 
  border-color: var(--success); 
  color: var(--success); 
  background: rgba(46, 125, 50, 0.05);
}

.btn.success:hover { 
  color: #1b5e20; 
  background: rgba(46, 125, 50, 0.1);
}

/* Form elements */
.input, select {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  width: 100%;
  font-size: 1rem;
  transition: all 0.2s;
}

.input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(93, 64, 55, 0.12);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--primary);
}

.form-group {
  margin-bottom: 20px;
}

/* Utility classes */
.sticky-actions { 
  position: sticky; 
  bottom: 0; 
  background: #fff; 
  padding: 16px 0; 
  border-top: 1px solid var(--border); 
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 10;
}

.row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

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

/* Status indicators */
.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status.success {
  background: rgba(46, 125, 50, 0.1);
  color: var(--success);
}

.status.warning {
  background: rgba(245, 127, 23, 0.1);
  color: var(--warning);
}

.status.danger {
  background: rgba(198, 40, 40, 0.1);
  color: var(--danger);
}

.status.info {
  background: rgba(2, 119, 189, 0.1);
  color: var(--info);
}

/* Table actions */
.table-actions a {
  color: var(--primary);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
  display: inline-block;
  font-size: 0.9rem;
}

.table-actions a:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--accent-light);
}

/* Messages */
.error { 
  color: var(--danger); 
  background: rgba(198, 40, 40, 0.05);
  padding: 10px 16px;
  border-radius: 8px;
  border-left: 3px solid var(--danger);
}

.success-message { 
  color: var(--success); 
  background: rgba(46, 125, 50, 0.05);
  padding: 10px 16px;
  border-radius: 8px;
  border-left: 3px solid var(--success);
}

/* Suggestions dropdown */
.suggest-container {
  position: relative;
}

.suggest-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 100;
}

.suggest-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: #fff;
  color: var(--text);
  transition: all 0.2s;
}

.suggest-item:hover {
  background: var(--accent-light);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  background: var(--scrollbar-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dark);
}

/* Textile-specific elements */
.fabric-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23d7ccc8' fill-opacity='0.1' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

.page-title {
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 24px;
  color: var(--primary);
}

.page-title:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 16px 8px;
    margin: 16px auto;
  }
  
  nav {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  
  .card {
    padding: 20px 16px;
  }
  
  th, td {
    padding: 10px 8px;
  }
  
  .row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .col-6 {
    grid-column: span 12;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    font-size: 12pt;
  }
  
  nav, .sidebar, .actions, .btn, .fabric-pattern {
    display: none !important;
  }
  
  .container, .panel {
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: none;
  }
  
  table {
    border: 1px solid #ddd;
    box-shadow: none;
  }
  
  th {
    background: #f5f5f5 !important;
    color: black;
  }
}

/* Session Expiration Banner Styles */
.session-expiration-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #c62828 0%, #d32f2f 100%);
  color: white;
  padding: 0;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.session-expiration-banner .banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 24px;
  max-width: 100%;
}

.session-expiration-banner i {
  font-size: 20px;
  flex-shrink: 0;
}

.session-expiration-banner .banner-message {
  flex: 1;
  font-weight: 500;
  font-size: 14px;
}

.session-expiration-banner .banner-message a {
  color: #ffeb3b;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s ease;
}

.session-expiration-banner .banner-message a:hover {
  color: #fff;
}

.session-expiration-banner .banner-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.session-expiration-banner .banner-close:hover {
  transform: scale(1.1);
}

/* Add margin to body when banner is visible */
body.banner-visible {
  padding-top: 56px;
}

@media (max-width: 768px) {
  .session-expiration-banner .banner-content {
    padding: 10px 12px;
    flex-wrap: wrap;
  }

  .session-expiration-banner .banner-message {
    font-size: 13px;
  }

  .session-expiration-banner i {
    font-size: 18px;
  }
}