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

:root {
  --bg-color: #fafafa;
  --surface-color: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --primary-color: #0f172a; /* Deep slate for premium feel */
  --primary-hover: #1e293b;
  --accent-color: #2563eb; /* Royal blue accent */
  --success-bg: #ecfdf5;
  --success-text: #059669;
  --danger-bg: #fef2f2;
  --danger-text: #dc2626;
  --warning-bg: #fffbeb;
  --warning-text: #d97706;
  --border-light: #f3f4f6;
  --border-medium: #e5e7eb;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --font-family: 'Outfit', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Premium Card / Surface */
.glass-panel {
  background: var(--surface-color);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 3rem;
  transition: var(--transition);
}

.glass-panel:hover {
  box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.08);
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h2 {
  font-size: 2rem;
}

p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1.05rem;
  font-weight: 300;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

a:hover {
  color: #1d4ed8;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-color);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-danger:hover {
  background: #b91c1c;
}

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

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

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

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}

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

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

.form-control {
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: var(--bg-color);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  background: var(--surface-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
  color: var(--text-tertiary);
  font-weight: 300;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2rem;
  padding-right: 2.5rem;
}

textarea.form-control {
  resize: vertical;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.toast {
  padding: 1.25rem 1.75rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 500;
  background: var(--surface-color);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  transform: translateY(150%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
}

.toast.success::before { background: var(--success-text); box-shadow: 0 0 10px var(--success-text); }
.toast.error::before { background: var(--danger-text); box-shadow: 0 0 10px var(--danger-text); }
.toast.warning::before { background: var(--warning-text); box-shadow: 0 0 10px var(--warning-text); }
.toast.info::before { background: var(--accent-color); box-shadow: 0 0 10px var(--accent-color); }

/* Layout Header */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 4rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a[style*="font-weight: 600"] {
  color: var(--primary-color);
}

/* Status Badges */
.status-badge {
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
}

.status-pending { background: var(--warning-bg); color: var(--warning-text); }
.status-approved { background: var(--success-bg); color: var(--success-text); }
.status-rejected { background: var(--danger-bg); color: var(--danger-text); }
.status-completed { background: #f3f4f6; color: #4b5563; }
.status-book-another-timing { background: #e0e7ff; color: #4338ca; }

/* Table */
.table-container {
  overflow-x: auto;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

th, td {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

th {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  background: var(--bg-color);
}

th:first-child { border-top-left-radius: var(--radius-md); }
th:last-child { border-top-right-radius: var(--radius-md); }

tr {
  transition: var(--transition);
}

tr:hover td {
  background: #f8fafc;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.stat-card {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0; width: 100px; height: 100px;
  background: linear-gradient(135deg, transparent, rgba(0,0,0,0.02));
  border-bottom-left-radius: 100px;
}

.stat-value {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--primary-color);
  line-height: 1;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  width: 90%;
  max-width: 600px;
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

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

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.close-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-medium);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.close-btn:hover {
  background: var(--text-primary);
  color: white;
  border-color: var(--text-primary);
  transform: rotate(90deg);
}

/* Perfect Mobile Responsiveness (down to 350px) */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  .container {
    padding: 1rem 0.5rem;
  }
  .header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    position: relative;
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .logo {
    margin: 0;
  }
  .nav-links {
    position: fixed;
    top: 0;
    right: -260px;
    width: 250px;
    height: 100%;
    bottom: 0;
    background: #ffffff;
    box-shadow: -5px 0 20px rgba(0,0,0,0.15);
    flex-direction: column;
    justify-content: flex-start;
    padding: 5rem 1.5rem 2rem 1.5rem;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    display: flex;
  }
  .nav-links.open {
    right: 0;
  }
  .nav-links a {
    width: 100%;
    text-align: left;
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 1.1rem;
    color: var(--text-color);
  }
  .nav-links button {
    margin-top: auto;
    width: 100%;
  }
  .hamburger-menu {
    display: block;
    font-size: 1.8rem;
    color: var(--primary-color);
    cursor: pointer;
    z-index: 1001;
  }
  .mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
  }
  .mobile-overlay.show {
    opacity: 1;
    visibility: visible;
  }
  .glass-panel {
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .stat-card {
    padding: 1.5rem;
  }
  .stat-value {
    font-size: 2.5rem;
  }
  .form-group {
    grid-column: 1 / -1 !important;
    margin-bottom: 1.25rem;
  }
  .btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    justify-content: center;
  }
  td .btn, th .btn {
    width: max-content;
    display: inline-flex;
  }
  .modal-content {
    width: 95%;
    padding: 1.5rem 1rem;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-header h3 {
    font-size: 1.25rem;
  }
  h2 {
    font-size: 1.5rem;
    text-align: center;
  }
  .table-container {
    margin: 0 -1rem;
    padding: 0 1rem;
    width: calc(100% + 2rem);
  }
  th, td {
    padding: 1rem 0.75rem;
    font-size: 0.85rem;
  }
  .status-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }
  .toast-container {
    bottom: 15px;
    right: 15px;
    left: 15px;
  }
  .toast {
    padding: 1rem;
    font-size: 0.85rem;
    width: 100%;
  }
}

@media (min-width: 769px) {
  .hamburger-menu {
    display: none;
  }
}
