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

:root {
  --bg-primary: #fbfaf7;
  --bg-secondary: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(197, 160, 89, 0.22);
  --accent-gold: #c5a059;
  --accent-gold-light: #f6f2e9;
  --accent-gold-dark: #8e6e30;
  --accent-gradient: linear-gradient(135deg, #c5a059 0%, #9e7b39 100%);
  --accent-gradient-secondary: linear-gradient(135deg, #e3cfa8 0%, #c5a059 100%);
  --text-primary: #332b24;
  --text-secondary: #756a5e;
  --text-muted: #9e9285;
  --success: #3c763d;
  --danger: #a94442;
  --warning: #8a6d3b;
  --sidebar-width: 260px;
  --transition-speed: 0.3s;
  --shadow-neon: 0 8px 30px rgba(197, 160, 89, 0.12);
  --shadow-neon-purple: 0 8px 30px rgba(142, 110, 48, 0.1);
  --shadow-soft: 0 10px 40px rgba(45, 37, 29, 0.05);
}

body[data-theme="dark-gold"] {
  --bg-primary: #11100e;
  --bg-secondary: #1a1815;
  --glass-bg: rgba(26, 24, 21, 0.8);
  --glass-border: rgba(216, 184, 120, 0.18);
  --accent-gold: #d8b878;
  --accent-gold-light: #2b261f;
  --accent-gold-dark: #b6985a;
  --accent-gradient: linear-gradient(135deg, #d8b878 0%, #b6985a 100%);
  --accent-gradient-secondary: linear-gradient(135deg, #f5e4c3 0%, #d8b878 100%);
  --text-primary: #f0e6dc;
  --text-secondary: #b5aaa0;
  --text-muted: #8e847c;
  --success: #4cae4c;
  --danger: #d9534f;
  --warning: #f0ad4e;
  --shadow-neon: 0 8px 30px rgba(216, 184, 120, 0.08);
  --shadow-neon-purple: 0 8px 30px rgba(182, 152, 90, 0.05);
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.4);
}

body[data-theme="emerald-gold"] {
  --bg-primary: #0a1c13;
  --bg-secondary: #12281c;
  --glass-bg: rgba(18, 40, 28, 0.8);
  --glass-border: rgba(216, 184, 120, 0.18);
  --accent-gold: #d8b878;
  --accent-gold-light: #1f372a;
  --accent-gold-dark: #b6985a;
  --accent-gradient: linear-gradient(135deg, #d8b878 0%, #b6985a 100%);
  --accent-gradient-secondary: linear-gradient(135deg, #f5e4c3 0%, #d8b878 100%);
  --text-primary: #e6f5ed;
  --text-secondary: #a3c7b5;
  --text-muted: #7e9c8e;
  --success: #5cb85c;
  --danger: #d9534f;
  --warning: #f0ad4e;
  --shadow-neon: 0 8px 30px rgba(216, 184, 120, 0.08);
  --shadow-neon-purple: 0 8px 30px rgba(182, 152, 90, 0.05);
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.4);
}

body[data-theme="sapphire-blue"] {
  --bg-primary: #0a1122;
  --bg-secondary: #101c33;
  --glass-bg: rgba(16, 28, 51, 0.8);
  --glass-border: rgba(92, 164, 236, 0.22);
  --accent-gold: #5ca4ec;
  --accent-gold-light: #1d2c47;
  --accent-gold-dark: #2a6db7;
  --accent-gradient: linear-gradient(135deg, #5ca4ec 0%, #2a6db7 100%);
  --accent-gradient-secondary: linear-gradient(135deg, #94c4f7 0%, #5ca4ec 100%);
  --text-primary: #e8f1fc;
  --text-secondary: #9cbadf;
  --text-muted: #7893b5;
  --success: #5cb85c;
  --danger: #d9534f;
  --warning: #f0ad4e;
  --shadow-neon: 0 8px 30px rgba(92, 164, 236, 0.08);
  --shadow-neon-purple: 0 8px 30px rgba(42, 109, 183, 0.05);
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.4);
}

body[data-theme="rose-gold"] {
  --bg-primary: #16151a;
  --bg-secondary: #222027;
  --glass-bg: rgba(34, 32, 39, 0.8);
  --glass-border: rgba(226, 180, 189, 0.22);
  --accent-gold: #e2b4bd;
  --accent-gold-light: #322d37;
  --accent-gold-dark: #c38b94;
  --accent-gradient: linear-gradient(135deg, #e2b4bd 0%, #c38b94 100%);
  --accent-gradient-secondary: linear-gradient(135deg, #f2d1d7 0%, #e2b4bd 100%);
  --text-primary: #f5f0f2;
  --text-secondary: #c9bfcb;
  --text-muted: #9f93a1;
  --success: #5cb85c;
  --danger: #d9534f;
  --warning: #f0ad4e;
  --shadow-neon: 0 8px 30px rgba(226, 180, 189, 0.08);
  --shadow-neon-purple: 0 8px 30px rgba(195, 139, 148, 0.05);
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', 'Sarabun', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(197, 160, 89, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* Sidebar Styling */
aside.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: all var(--transition-speed);
  box-shadow: 2px 0 20px rgba(197, 160, 89, 0.03);
}

aside.sidebar.collapsed {
  width: 76px;
}

aside.sidebar.collapsed .sidebar-logo h1,
aside.sidebar.collapsed .menu-item span,
aside.sidebar.collapsed .sidebar-menu-group-title,
aside.sidebar.collapsed .company-badge div {
  display: none !important;
}

aside.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 20px 10px;
}

aside.sidebar.collapsed .sidebar-menu {
  padding: 0 10px;
}

aside.sidebar.collapsed .menu-item {
  justify-content: center;
  padding: 14px;
}

aside.sidebar.collapsed .company-badge {
  justify-content: center;
  padding: 10px;
}

aside.sidebar.collapsed .sidebar-footer {
  padding: 15px 10px;
}

.sidebar-logo {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

#sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sidebar-toggle:hover {
  color: var(--accent-gold);
  background: var(--accent-gold-light);
}

.sidebar-logo img {
  height: 35px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(197, 160, 89, 0.2));
}

.sidebar-logo h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-menu-group-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 15px;
  margin-bottom: 5px;
  padding-left: 20px;
  text-align: left;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 16px;
  flex: 1;
  overflow-y: auto;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--accent-gold);
  opacity: 0;
  transition: var(--transition-speed);
}

.menu-item i {
  font-size: 20px;
  transition: var(--transition-speed);
}

.menu-item:hover {
  color: var(--text-primary);
  background: var(--accent-gold-light);
  transform: translateX(4px);
}

.menu-item.active {
  color: var(--accent-gold-dark);
  background: var(--accent-gold-light);
  border-right: 1px solid rgba(197, 160, 89, 0.15);
  font-weight: 600;
}

.menu-item.active::before {
  opacity: 1;
}

.menu-item.active i {
  color: var(--accent-gold);
  filter: drop-shadow(0 0 4px rgba(197, 160, 89, 0.3));
}

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

.company-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--accent-gold-light);
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}

.company-badge i {
  font-size: 18px;
  color: var(--accent-gold);
}

.company-badge div h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.company-badge div p {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Main Container Styling */
main.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 40px;
  min-height: 100vh;
  position: relative;
  transition: all var(--transition-speed);
  z-index: 1;
}

main.main-content.collapsed-sidebar {
  margin-left: 76px;
}

/* Header Area */
header.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-title h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.header-title p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.header-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}

.month-year-selector {
  display: flex;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.month-year-selector select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  padding: 4px;
}

.month-year-selector select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Dynamic glow effect background elements */
.glow-blur {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(150px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.2;
}

.glow-cyan {
  background: #fdf5e6; /* Gold/warm glow */
  top: -100px;
  right: -50px;
  animation: floatBlur 15s infinite alternate;
}

.glow-purple {
  background: #f3ebdb;
  bottom: -100px;
  left: 20%;
  animation: floatBlur 20s infinite alternate-reverse;
}

/* Section Switching Styling */
section.tab-content {
  display: none;
  position: relative;
  z-index: 1;
}

section.tab-content.active {
  display: block;
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Cards & Glassmorphism design */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
  position: relative;
  overflow: hidden;
}

.glass-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(30deg);
  transition: 0.8s;
  pointer-events: none;
}

.glass-card:hover::after {
  left: 120%;
}

.glass-card:hover {
  transform: translateY(-5px);
  border-color: rgba(197, 160, 89, 0.4);
  box-shadow: 0 15px 35px rgba(197, 160, 89, 0.08), var(--shadow-soft);
}

/* Dashboard Metric Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.metric-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--accent-gold-dark);
  background: var(--accent-gold-light);
  border: 1px solid var(--glass-border);
}

.metric-info h3 {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-info p {
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.metric-change {
  font-size: 11px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}

.metric-change.up {
  color: var(--success);
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.chart-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Buttons Styling */
.btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(197, 160, 89, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(197, 160, 89, 0.4), var(--shadow-neon);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--accent-gold-dark);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
}

.btn-secondary:hover {
  background: var(--accent-gold-light);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(169, 68, 66, 0.1);
  color: var(--danger);
  border: 1px solid rgba(169, 68, 66, 0.2);
}

.btn-danger:hover {
  background: rgba(169, 68, 66, 0.2);
  transform: translateY(-2px);
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: all var(--transition-speed);
}

.btn-icon:hover {
  color: var(--text-primary);
  background: var(--accent-gold-light);
  border-color: var(--accent-gold);
  transform: scale(1.05);
}

.btn-icon.edit:hover {
  color: var(--accent-gold-dark);
  border-color: rgba(197, 160, 89, 0.5);
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.15);
}

.btn-icon.delete:hover {
  color: var(--danger);
  border-color: rgba(169, 68, 66, 0.3);
  box-shadow: 0 0 10px rgba(169, 68, 66, 0.1);
}

/* Data Table Styling */
.table-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  padding: 10px 18px;
  border-radius: 12px;
  width: 300px;
  box-shadow: var(--shadow-soft);
  transition: all var(--transition-speed);
}

.search-box:focus-within {
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-neon);
}

.search-box i {
  color: var(--text-secondary);
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  font-size: 14px;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.data-table th {
  background: var(--accent-gold-light);
  padding: 18px 24px;
  color: var(--accent-gold-dark);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border);
}

table.data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(197, 160, 89, 0.1);
  font-size: 14px;
  color: var(--text-primary);
  transition: background var(--transition-speed);
  background: var(--bg-secondary);
}

table.data-table tbody tr:last-child td {
  border-bottom: none;
}

table.data-table tbody tr:hover td {
  background: var(--accent-gold-light);
}

/* Table profile avatar badge */
.avatar-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.avatar-badge.pink {
  background: var(--accent-gradient-secondary);
  color: var(--accent-gold-dark);
}

.emp-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.emp-name h4 {
  font-weight: 600;
  font-size: 14px;
}

.emp-name p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Interactive editable cell */
td.editable-cell {
  position: relative;
  cursor: pointer;
}

td.editable-cell::after {
  content: '\f304';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  color: var(--accent-gold);
  transition: opacity 0.2s;
  font-size: 11px;
}

td.editable-cell:hover::after {
  opacity: 0.7;
}

td.editable-cell:hover {
  background: var(--accent-gold-light) !important;
}

td.editable-cell input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-gold);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
  outline: none;
  box-shadow: 0 0 8px rgba(197, 160, 89, 0.2);
}

/* Modals Styling */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(45, 37, 29, 0.4);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.modal-window {
  width: 100%;
  max-width: 550px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(45, 37, 29, 0.15), var(--shadow-neon);
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.active .modal-window {
  transform: scale(1);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--accent-gold-light);
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-gold-dark);
}

.modal-close {
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(197, 160, 89, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold-dark);
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--accent-gold);
  color: #ffffff;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--accent-gold-light);
}

/* Forms layout inside modals & page views */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group select {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all var(--transition-speed);
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-neon);
  background: var(--accent-gold-light);
}

/* OT Overtime Tracker View layout */
.ot-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

/* Payslip Workspace Configuration */
.payslip-workspace {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 30px;
  align-items: start;
}

.payslip-form-card {
  position: sticky;
  top: 20px;
  background: var(--bg-secondary);
  border-color: var(--glass-border);
}

/* Double-slip structure */
.payslip-pane {
  display: flex;
  justify-content: center;
  padding: 0;
  width: 100%;
}

.payslip-container-double {
  width: 100%;
  max-width: 800px;
  background: #ffffff;
  color: #000000;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(197, 160, 89, 0.08);
  border-radius: 16px;
  border: 2px solid var(--accent-gold);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.payslip-single-part {
  border: 1px solid #c5a059;
  padding: 20px;
  border-radius: 8px;
  position: relative;
  font-size: 12px;
  font-family: 'Sarabun', sans-serif;
  line-height: 1.4;
  background: #fffdfa;
}

.slip-badge-type {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold-dark);
  background: var(--accent-gold-light);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
}

.payslip-header {
  border-bottom: 2px solid var(--accent-gold);
  padding-bottom: 10px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.company-info h2 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 2px;
  color: var(--accent-gold-dark);
}

.company-info p {
  font-size: 10px;
  color: #555;
}

.slip-title {
  text-align: right;
  padding-right: 120px; /* Leave space for slip badge */
}

.slip-title h3 {
  font-size: 14px;
  font-weight: 700;
  color: #000;
}

.slip-title p {
  font-size: 10px;
  color: #333;
}

.employee-info-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border: 1px solid var(--accent-gold);
  padding: 10px;
  margin-bottom: 12px;
  background: #ffffff;
}

.info-item {
  display: flex;
  gap: 8px;
}

.info-item .label {
  font-weight: 700;
  min-width: 80px;
  color: #000;
}

.payslip-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.payslip-table th {
  border: 1px solid var(--accent-gold);
  padding: 6px;
  background-color: var(--accent-gold-light);
  font-weight: 700;
  text-align: left;
  font-size: 11px;
}

.payslip-table td {
  border: 1px solid var(--accent-gold);
  padding: 6px;
  vertical-align: top;
  height: 90px;
  background: #ffffff;
}

.payslip-table-totals td {
  height: auto;
  font-weight: 700;
  background-color: #faf9f6 !important;
}

.slip-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.slip-row.total {
  border-top: 1px solid var(--accent-gold);
  padding-top: 4px;
  font-weight: 700;
  color: #000;
}

.net-pay-box {
  border: 2px solid var(--accent-gold);
  background: var(--accent-gold-light);
  padding: 8px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 13px;
}

.net-pay-box .text {
  font-weight: 800;
  color: var(--accent-gold-dark);
}

.net-pay-box .value {
  font-weight: 800;
  font-size: 16px;
  color: #000;
}

.signatures-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 15px;
}

.signature-line {
  text-align: center;
}

.signature-line .line {
  border-bottom: 1px solid #8e6e30;
  height: 35px;
  width: 180px;
  margin: 0 auto 6px auto;
}

/* Tear Divider Perforation Line style */
.perforation-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 10px 0;
  position: relative;
  user-select: none;
}

.perforation-divider .dashed-line {
  flex: 1;
  border-bottom: 2px dashed var(--accent-gold);
  opacity: 0.7;
}

.perforation-divider .divider-text {
  color: var(--accent-gold-dark);
  font-size: 11px;
  font-weight: 600;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.perforation-divider .divider-text i {
  font-size: 13px;
  transform: rotate(-30deg);
}

/* Animations declarations */
@keyframes floatBlur {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 10%) scale(1.1); }
  100% { transform: translate(-5%, -5%) scale(0.9); }
}

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Print Only class helper */
.print-only {
  display: none;
}

#summary-report-print-area {
  font-family: 'Sarabun', sans-serif;
  color: #000;
  background: #fff;
  padding: 30px;
}
#summary-report-print-area h2 {
  font-size: 20px;
  text-align: center;
  margin-bottom: 5px;
  font-weight: 700;
}
#summary-report-print-area h3 {
  font-size: 16px;
  text-align: center;
  margin-bottom: 25px;
  font-weight: 600;
}
#summary-report-print-area table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}
#summary-report-print-area th, #summary-report-print-area td {
  border: 1px solid #000;
  padding: 8px 10px;
  font-size: 11px;
  text-align: right;
}
#summary-report-print-area th:nth-child(1),
#summary-report-print-area th:nth-child(2),
#summary-report-print-area td:nth-child(1),
#summary-report-print-area td:nth-child(2) {
  text-align: left;
}
#summary-report-print-area th {
  background-color: #f2f2f2 !important;
  font-weight: bold;
  text-align: center;
}
#summary-report-print-area tr.totals-row td {
  font-weight: bold;
  background-color: #f5f5f5 !important;
  border-top: 2px double #000;
}
#summary-report-print-area .report-signatures {
  display: flex;
  justify-content: space-around;
  margin-top: 60px;
}
#summary-report-print-area .signature-block {
  text-align: center;
  width: 250px;
}
#summary-report-print-area .signature-block .line {
  border-bottom: 1px dashed #000;
  height: 40px;
  margin-bottom: 8px;
}

/* Media Printing Styles */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 15mm; /* Balanced standard page margin */
  }

  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  #summary-report-print-area {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    background: #ffffff !important;
  }
  
  aside.sidebar,
  header.content-header,
  .table-header-bar,
  .btn,
  .glow-blur,
  .month-year-selector,
  .no-print,
  section.tab-content {
    display: none !important;
  }
  
  main.main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  
  /* Payslip Print Mode */
  body.print-payslip-mode section.tab-content#payslip {
    display: block !important;
  }
  
  body.print-payslip-mode .payslip-workspace {
    display: block !important;
  }
  
  body.print-payslip-mode .payslip-pane {
    padding: 0 !important;
  }
  
  body.print-payslip-mode .payslip-container-double {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 280mm !important; /* Constraint within A4 printable area */
    gap: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }
  
  body.print-payslip-mode .payslip-single-part {
    border-color: #000000 !important;
    background: #ffffff !important;
    padding: 10px 16px !important; /* Tighten padding */
    border-radius: 6px !important;
    height: 132mm !important; /* Exact height for each of the two slips to fit in one page */
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
  }
  
  body.print-payslip-mode .slip-badge-type {
    border-color: #000000 !important;
    color: #000000 !important;
    background: #ffffff !important;
    top: 10px !important;
    right: 16px !important;
    padding: 2px 8px !important;
  }
  
  body.print-payslip-mode .perforation-divider {
    margin: 2px 0 !important;
    height: 12mm !important;
  }

  body.print-payslip-mode .perforation-divider .dashed-line {
    border-color: #000000 !important;
  }
  
  body.print-payslip-mode .perforation-divider .divider-text {
    color: #000000 !important;
  }
  
  body.print-payslip-mode .employee-info-box, 
  body.print-payslip-mode .payslip-table th, 
  body.print-payslip-mode .payslip-table td, 
  body.print-payslip-mode .net-pay-box {
    border-color: #000000 !important;
  }

  body.print-payslip-mode .employee-info-box {
    padding: 4px 8px !important;
    margin-bottom: 6px !important;
    gap: 4px !important;
  }
  
  body.print-payslip-mode .payslip-table {
    margin-bottom: 6px !important;
  }

  body.print-payslip-mode .payslip-table th {
    background-color: #f2f2f2 !important;
    padding: 4px 6px !important;
  }

  body.print-payslip-mode .payslip-table td {
    height: 55px !important; /* Shortened row heights */
    padding: 4px 6px !important;
  }
  
  body.print-payslip-mode .slip-row {
    margin-bottom: 2px !important;
  }

  body.print-payslip-mode .net-pay-box {
    background-color: #f2f2f2 !important;
    padding: 5px 12px !important;
    margin-bottom: 6px !important;
  }

  body.print-payslip-mode .signatures-box {
    margin-top: 4px !important;
  }

  body.print-payslip-mode .signature-line .line {
    height: 20px !important;
  }
  
  body.print-payslip-mode .company-info h2 {
    font-size: 13px !important;
  }

  body.print-payslip-mode .slip-title h3 {
    font-size: 12px !important;
  }

  body.print-payslip-mode .net-pay-box .value {
    font-size: 14px !important;
  }
  
  body.print-payslip-mode .net-pay-box .text {
    font-size: 11px !important;
  }

  /* Summary Report, Expense Report & Receipt Print Mode */
  body.print-report-mode #summary-report-print-area,
  body.print-expense-report-mode #summary-report-print-area,
  body.print-receipt-mode #summary-report-print-area {
    display: block !important;
  }
}

/* Small Responsive Tweaks */
@media (max-width: 1100px) {
  .payslip-workspace {
    grid-template-columns: 1fr;
  }
  .payslip-form-card {
    position: static;
  }
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  aside.sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-speed) ease-in-out;
  }
  aside.sidebar.mobile-active {
    transform: translateX(0);
    z-index: 1010;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
  }
  main.main-content {
    margin-left: 0;
    padding: 16px;
    width: 100%;
  }
  .ot-layout {
    grid-template-columns: 1fr;
  }
  #mobile-menu-toggle {
    display: inline-flex !important;
  }
  .content-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }
  .header-controls {
    flex-wrap: wrap !important;
    width: 100% !important;
    justify-content: flex-start !important;
    gap: 10px !important;
  }
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .form-group.full-width {
    grid-column: span 1 !important;
  }
  .modal-window {
    width: 95% !important;
    margin: 10px !important;
    max-height: 90vh !important;
    display: flex;
    flex-direction: column;
  }
  .modal-body {
    overflow-y: auto !important;
  }
}

/* Dashboard Sub-tab Button Active State */
.db-subtab-btn.active {
  background: var(--accent-gold) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(197, 160, 89, 0.35) !important;
  border-color: var(--accent-gold) !important;
}
.db-subtab-btn:hover {
  background: rgba(197, 160, 89, 0.15);
  color: var(--accent-gold-dark);
}

/* Theme Switcher Styles */
.theme-switcher-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}
.theme-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.theme-dots-group {
  display: flex;
  gap: 8px;
}
.theme-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: all 0.2s ease-in-out;
}
.theme-dot:hover {
  transform: scale(1.25);
}
.theme-dot.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 6px var(--accent-gold);
  transform: scale(1.15);
}
.theme-dot-gold-white { background: #fbfaf7; border: 2px solid #c5a059; }
.theme-dot-dark-gold { background: #1a1815; border: 2px solid #d8b878; }
.theme-dot-emerald { background: #0a1c13; border: 2px solid #d8b878; }
.theme-dot-sapphire { background: #0a1122; border: 2px solid #5ca4ec; }
.theme-dot-rose { background: #16151a; border: 2px solid #e2b4bd; }

/* Custom print-preview layout adjustments */
.quotation-preview-box {
  background: #ffffff;
  color: #000000;
  border: 1.5px solid #000;
  border-radius: 0;
  padding: 24px;
  box-shadow: var(--shadow-soft);
  max-width: 750px;
  margin: 0 auto;
  min-height: 800px;
  font-family: 'Sarabun', sans-serif;
}
.quotation-preview-box table th {
  background: #f2f2f2 !important;
  color: #000 !important;
  border: 1px solid #000 !important;
}
.quotation-preview-box table td {
  border: 1px solid #000 !important;
  color: #000 !important;
}
.quotation-preview-box .text-muted {
  color: #555555 !important;
}
.quotation-preview-box input, .quotation-preview-box textarea {
  border: none !important;
  background: transparent !important;
  color: #000 !important;
  padding: 0 !important;
}

