:root{
  --page-bg: #0f172a;
  --card-bg: #ffffff;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px 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);
}

*{ 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

body{
  margin:0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  background: linear-gradient(135deg, #d4ebe3 0%, #cbe6dd 100%);
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--text);
  line-height: 1.5;
}

/* Login Card */
.login-card{
  width: 440px;
  max-width: 95vw;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.brand{
  text-align:center;
  margin-bottom: 32px;
}

.brand .logo{
  font-weight: 800;
  letter-spacing: -1px;
  font-size: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 8px;
}

.brand .company{
  margin: 0;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 14px;
}

.brand .panel-title{
  margin: 24px 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.brand .subtitle{
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Form Elements - Professional Style */
.form-group{
  margin-top: 20px;
}

.form-group label{
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

input, select, textarea{
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  font-size: 14px;
  color: var(--text);
  background: white;
  transition: all 0.2s ease;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input:disabled{
  background: #f8fafc;
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Buttons - Professional Style */
button{
  width: 100%;
  padding: 12px 20px;
  margin-top: 20px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
  font-family: inherit;
}

button:hover{
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

button:active{
  transform: translateY(0);
}

.small-button{
  width: auto;
  margin: 0;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
}

/* Error Message */
.error-message{
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 13px;
  font-weight: 500;
}

.footer{
  margin-top: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Dashboard */
.dashboard{
  width: 1000px;
  max-width: calc(100vw - 40px);
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.dashboard h1{ 
  margin: 0 0 8px; 
  font-size: 28px;
  font-weight: 700;
}

.dashboard p{ 
  margin: 0 0 24px; 
  color: var(--text-muted); 
}

.dashboard .topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.dashboard .logout{
  width: auto;
  margin: 0;
  padding: 10px 20px;
}

/* Card Styling - Professional */
.card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text);
}

.card p {
  font-size: 14px;
  margin: 0;
  color: var(--text-muted);
}

/* Seat Grid - Professional Design */
#seatGrid, #bookingSeatGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.seat-box {
  background: white;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.seat-box:hover:not(.booked):not(.purchased) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.seat-box.available {
  background: white;
  border-color: var(--border);
}

.seat-box.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.seat-box.booked, 
.seat-box.purchased {
  background: #f0f9ff;
  border-color: #0ea5e9;
  cursor: default;
}

.seat-header {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
}

.seat-box.booked .seat-header,
.seat-box.purchased .seat-header {
  color: #0284c7;
}

.seat-box.selected .seat-header {
  color: rgba(255,255,255,0.9);
}

.seat-main {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seat-icon {
  width: 24px;
  height: 24px;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.seat-box.booked .seat-icon,
.seat-box.purchased .seat-icon {
  background: #38bdf8;
}

.seat-box.selected .seat-icon {
  background: rgba(255,255,255,0.25);
}

.seat-icon svg {
  width: 14px;
  height: 14px;
  fill: var(--text-muted);
}

.seat-box.booked .seat-icon svg,
.seat-box.purchased .seat-icon svg {
  fill: white;
}

.seat-box.selected .seat-icon svg {
  fill: white;
}

.seat-number {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.seat-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #0ea5e9;
  color: white;
  font-size: 8px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.seat-box.selected .seat-badge {
  background: rgba(255,255,255,0.3);
}

.seat-footer {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.seat-box.booked .seat-footer,
.seat-box.purchased .seat-footer {
  color: #0284c7;
}

.seat-box.selected .seat-footer {
  color: rgba(255,255,255,0.9);
}

/* Tables - Professional */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table th {
  background: #f8fafc;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border);
}

table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

table tr:hover {
  background: #f8fafc;
}

/* Shared responsive table treatment.  It preserves the existing data and actions,
   while avoiding clipped columns on narrow screens. */
.table-wrap, .courier-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 720px) {
  .dashboard { max-width: calc(100vw - 20px); padding: 16px; border-radius: 12px; }
  .dashboard .topbar { align-items: flex-start; flex-direction: column; }
  .card { padding: 16px; }
  table th, table td { padding: 9px 8px; font-size: 12px; }
}

@media print {
  @page { margin: 7mm; }
  body { background: #fff !important; }
  .no-print, .logout, button, .modal-overlay { display: none !important; }
  .table-wrap, .courier-table-wrap { overflow: visible !important; border: 0 !important; }
  table { width: 100% !important; table-layout: auto; }
  table th, table td { padding: 4px 5px !important; font-size: 9px !important; vertical-align: top; }
  table th { white-space: nowrap; }
}

/* Legend */
#seatLegend, #bookingSeatLegend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 500;
}

/* Modal Styling */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal {
  width: 500px;
  max-width: 100%;
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.close-x {
  width: auto;
  margin: 0;
  padding: 8px 12px;
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
}

.close-x:hover {
  background: #e2e8f0;
}
