 /* --- Base Styles --- */
 body { margin: 0; font-family: Arial, sans-serif; background: #f5f5f5; }
 .admin-container { display: flex; flex-direction: column; min-height: 100vh; }
 .admin-header { background: #fff; padding: 15px 20px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
 .admin-header .header-content { display: flex; flex-direction: column; align-items: center; text-align: center; flex-grow: 1; }
 .admin-header h1 { margin: 5px 0 0 0; color: #333; font-size: 1.5rem; }
 .admin-header p { margin: 0 0 10px 0; color: #555; font-size: 0.9rem; }
 .logo { width: 80px; height: 80px; display: block; background: #f0f0f0; border-radius: 50%; overflow: hidden; }
 .logo img { width: 100%; height: 100%; object-fit: cover; }
 .admin-content { display: flex; flex: 1; }
 .admin-sidebar { width: 250px; background: #fff; padding: 20px; box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1); flex-shrink: 0; transition: width 0.3s ease; }
 .sidebar-btn { display: block; width: 100%; padding: 12px 15px; margin-bottom: 10px; background: #f5f5f5; border: none; border-radius: 4px; text-align: left; cursor: pointer; color: #333; font-size: 0.95rem; transition: background-color 0.2s ease, color 0.2s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
 .sidebar-btn.active { background: #ff6200; color: white; }
 .sidebar-btn:hover:not(.active) { background: #e0e0e0; color: #333; }
 .sidebar-btn.active:hover { background: #e55a00; color: white; }
 .admin-main { flex: 1; padding: 20px; overflow-x: hidden; }
 .admin-section { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); margin-bottom: 20px; }
 .admin-section:last-child { margin-bottom: 0; }
 .hidden { display: none !important; }
 /* --- Buttons --- */
 .btn-primary, .btn-secondary, .btn-logout, .btn-sm { padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9rem; transition: background-color 0.2s ease; white-space: nowrap; }
 .btn-sm { padding: 5px 10px; font-size: 0.8rem; } /* Smaller buttons for table actions */
 .btn-primary { background: #ff6200; color: white; }
 .btn-primary:hover { background: #e55a00; }
 .btn-secondary { background: #6c757d; color: white; }
 .btn-secondary:hover { background: #5a6268; }
 .btn-logout { background: #dc3545; color: white; }
 .btn-logout:hover { background: #c82333; }
 /* --- Forms --- */
 .form-group { margin-bottom: 15px; }
 label { display: block; margin-bottom: 5px; color: #666; font-weight: bold; }
 input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], select, input[type="time"] { /* Added input[type="time"] */
     width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; font-size: 1rem;
 }
 input, select { height: 40px; } /* Applies height to text, email, password, date, number, time */
 /* --- Tables --- */
 .table-container { overflow-x: auto; margin-top: 20px; width: 100%; }
 table { width: 100%; border-collapse: collapse; min-width: 600px; background-color: #fff; }
 th, td { padding: 12px 15px; border: 1px solid #ddd; text-align: left; vertical-align: middle; white-space: nowrap; }
 th { background: #f8f9fa; color: #333; font-weight: bold; position: sticky; top: 0; z-index: 1; }
 td button { margin-right: 5px;} /* Space between action buttons */
 /* --- Specific Sections & Elements --- */
 .filters, .export-options { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; align-items: flex-end; background-color: #fdfdfd; padding: 15px; border-radius: 5px; border: 1px solid #eee; }
 .filters .form-group, .export-options .form-group { margin-bottom: 0; flex: 1 1 180px; }
 .filters button, .export-options button { flex-shrink: 0; height: 40px; align-self: flex-end; margin-top: 10px; }
 .qr-management { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; }
 #qrCodeContainer { margin-top: 15px; display: flex; justify-content: center; /* Center the single QR */ }
 .qr-code-item { margin: 0; text-align: center; padding: 15px; border: 1px solid #eee; border-radius: 4px; background-color: #fff; word-wrap: break-word; }
 .qr-code-item h4 { margin-top: 0; margin-bottom: 10px; font-size: 0.9rem; }
 .qr-code-item canvas, .qr-code-item img { max-width: 100%; height: auto; display: block; margin: 0 auto 10px auto; }
 .staff-form { margin-top: 20px; padding: 20px; border: 1px solid #eee; border-radius: 5px; background-color: #fafafa; }
 .staff-list { margin-top: 30px; }
 .status-ok { color: #28a745; font-weight: bold; }
 .status-warning { color: #ffc107; font-weight: bold; }
 .status-error { color: #dc3545; font-weight: bold; }
 /* --- Contact Section Styles --- */
 .contact-info { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; }
 .contact-item { margin-bottom: 0; padding: 25px; border-bottom: none; background: white; border-radius: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08); transition: transform 0.3s ease, box-shadow 0.3s ease; border-left: 5px solid #ff6200; display: flex; flex-direction: column; }
 .contact-item:hover { transform: translateY(-5px); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12); }
 .contact-item-header { display: flex; align-items: center; margin-bottom: 15px; }
 .contact-icon-wrapper { background-color: #ff6200; color: white; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; margin-right: 15px; flex-shrink: 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
 .contact-item h3 { margin: 0; color: #333; font-size: 1.2rem; }
 .contact-item p { color: #555; line-height: 1.6; margin-bottom: 15px; flex-grow: 1; font-size: 0.95rem; }
 .contact-details { margin-bottom: 20px; padding-left: 5px; border-left: 2px solid #eee; }
 .contact-details p { margin-bottom: 8px; font-size: 0.9rem; }
 .contact-details strong { color: #333; }
 .contact-details a { color: #ff6200; text-decoration: none; transition: color 0.2s ease; }
 .contact-details a:hover { color: #e55a00; text-decoration: underline; }
 .contact-item button { background-color: #f0f0f0; color: #333; border: 1px solid #ddd; padding: 8px 15px; border-radius: 5px; cursor: pointer; transition: background-color 0.3s ease, border-color 0.3s ease; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 8px; margin-top: auto; /* Push button to bottom */ align-self: flex-start; /* Align button left */ }
 .contact-item button:hover { background-color: #e0e0e0; border-color: #ccc; }
 .contact-item button svg { stroke: #555; width: 16px; height: 16px; }
 /* --- Office Location Specific Styling --- */
 #map { height: 400px; width: 100%; margin-top: 20px; border-radius: 5px; border: 1px solid #ddd; }
 .location-form { /* Added style for location form container */ padding: 20px; border: 1px solid #eee; border-radius: 5px; background-color: #fafafa; margin-bottom: 20px;}
 .location-form p { font-size: 1rem; color: #333; margin-bottom: 15px;}
 .location-form #currentLocation { font-weight: bold; color: #ff6200; }
 .location-form button { margin-top: 10px; margin-right: 10px; }
 /* --- Modal Styles --- */
 .modal { display: none; position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); }
 .modal-content { background-color: #fefefe; margin: 10% auto; padding: 25px; border: 1px solid #888; width: 80%; max-width: 500px; border-radius: 8px; position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.2);}
 .close-button { color: #aaa; position: absolute; top: 10px; right: 15px; font-size: 28px; font-weight: bold; line-height: 1;}
 .close-button:hover, .close-button:focus { color: black; text-decoration: none; cursor: pointer; }
 .modal h2 { margin-top: 0; color: #ff6200; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 10px;}
 .modal .form-group { margin-bottom: 20px; }
 .modal button { margin-right: 10px; margin-top: 10px; }
 .modal .error-message { margin-top: 15px; color: red; min-height: 1em; font-size: 0.9em;}
 .modal p { margin-bottom: 10px; color: #555; }
 .modal p strong { color: #333; }

 /* --- NEW Styles for Attendance Settings --- */
 /* (These are added without removing any original styles) */
 .attendance-settings-form {
     margin-top: 20px;
     padding: 20px;
     border: 1px solid #eee;
     border-radius: 5px;
     background-color: #fafafa;
 }
 .attendance-settings-form .form-group {
      /* Overrides default form-group margin slightly for better alignment */
      margin-bottom: 10px;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px 20px; /* Row gap, Column gap */
 }
 .attendance-settings-form label {
     /* Adjust label width as needed */
     flex-basis: 220px; /* Increased width for longer labels */
     flex-shrink: 0;
     margin-bottom: 0; /* Remove default margin from label */
      text-align: right; /* Align label text right */
      padding-right: 10px; /* Add some space after label */
      font-weight: normal; /* Use normal weight if bold is too much */
      color: #555;
 }
 .attendance-settings-form input[type="time"],
 .attendance-settings-form input[type="number"] {
      /* Allow input to take remaining space */
      flex-grow: 1;
      /* Limit width of specific inputs if they become too wide */
      max-width: 200px;
      /* Ensure width isn't 100% when flexed */
      width: auto;
 }
  .attendance-settings-form button {
      /* Align button to the start or add margin */
      margin-top: 15px;
      margin-left: 240px; /* Align with input fields (label width + gaps) - adjust as needed */
  }
  #attendanceSettingsMsg { /* Style for the message div */
      margin-top: 15px;
      margin-left: 240px; /* Align with button */
      font-size: 0.9em;
      min-height: 1em;
  }

 /* --- Responsive Styles --- */
 /* Keep all original @media queries */
 @media (max-width: 992px) {
     .admin-sidebar { width: 220px; }
      th, td { white-space: normal;} /* Allow wrap on medium */
      .attendance-settings-form label { text-align: left; flex-basis: 100%; margin-bottom: 5px;} /* Stack label on medium */
      .attendance-settings-form button, #attendanceSettingsMsg { margin-left: 0; } /* Reset margin */
      .attendance-settings-form input[type="time"],
      .attendance-settings-form input[type="number"] { max-width: 100%; } /* Allow full width */
 }
 @media (max-width: 768px) {
     .admin-content { flex-direction: column; }
     .admin-sidebar { width: 100%; margin-bottom: 15px; padding: 10px; display: flex; flex-wrap: wrap; gap: 5px; border-bottom: 1px solid #eee; box-shadow: none; }
     .sidebar-btn { width: auto; flex-grow: 1; text-align: center; margin-bottom: 0; padding: 8px 12px; font-size: 0.9rem;}
     .admin-header { flex-direction: column; padding: 15px; }
     .admin-header .header-content { margin-bottom: 10px;}
     .filters, .export-options { flex-direction: column; align-items: stretch; }
     .filters .form-group, .export-options .form-group { flex: 1 1 auto; } /* Reset flex basis */
     #map { height: 300px; }
     .contact-info { grid-template-columns: 1fr; } /* Stack contact cards */
     .location-form button { margin-right: 5px; } /* Reduce margin */
 }
  @media (max-width: 576px) {
      .admin-main { padding: 15px; }
      .admin-section { padding: 15px;}
      th, td { padding: 10px 8px; font-size: 0.85rem;}
      table {min-width: 100%;} /* Allow table to shrink */
      th, td { white-space: normal; } /* Force wrap on small */
      .btn-primary, .btn-secondary, .btn-logout, .btn-sm { font-size: 0.85rem; padding: 8px 12px;}
      .btn-sm { padding: 4px 8px;}
      .modal-content { width: 90%; margin: 15% auto; padding: 20px;}
      .modal h2 { font-size: 1.3rem;}
  }