/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #F5A623;
  --primary-dark: #E09515;
  --primary-light: #FFF3E0;
  --secondary: #F8F8F8;
  --success: #4ECBA1;
  --danger: #E05A5A;
  --text: #2D2D2D;
  --text-light: #8E8E8E;
  --border: #EFEFEF;
  --white: #FFFFFF;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-sm: 4px;
  --radius-pill: 20px;
}

body {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  direction: rtl;
  overflow-x: hidden;
}

/* ===== Header ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  direction: rtl;
}

.header-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.header h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  text-align: right;
  padding-right: 10px;
}

/* ===== Bell ===== */
.bell-container {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.bell-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.bell-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.tab-btn {
  flex: 1;
  padding: 10px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  transition: all 0.2s;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  font-weight: 700;
}

.tab-btn:hover:not(.active) {
  color: var(--text);
}

/* ===== Tab Content ===== */
.tab-content {
  display: none;
  padding: 16px;
}

.tab-content.active {
  display: block;
}

/* ===== Section ===== */
.section {
  margin-bottom: 20px;
}

.section > label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* ===== Search Box ===== */
.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: var(--secondary);
  transition: all 0.2s;
  color: var(--text);
}

.search-box input::placeholder {
  color: var(--text-light);
}

.search-box input:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  gap: 10px;
  transition: background 0.15s;
}

.search-result-item:hover {
  background: var(--primary-light);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.user-email {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 1px;
}

/* ===== Selected Attendees ===== */
.selected-attendees {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.attendee-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  border: 1px solid rgba(245, 166, 35, 0.3);
  border-radius: var(--radius-pill);
  padding: 5px 10px 5px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.attendee-tag img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.attendee-tag .avatar-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attendee-tag .remove-btn {
  cursor: pointer;
  color: var(--text-light);
  font-size: 16px;
  line-height: 1;
  margin-right: 2px;
  transition: color 0.15s;
}

.attendee-tag .remove-btn:hover {
  color: var(--danger);
}

/* ===== Date Range ===== */
.date-range {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.date-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.date-field span {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

.date-field input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: var(--secondary);
  transition: all 0.2s;
  color: var(--text);
}

.date-field input:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

/* ===== Slots List ===== */
.slots-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.slot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--white);
}

.slot-item:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.slot-label {
  font-size: 13px;
  font-weight: 500;
}

.slot-arrow {
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
}

/* ===== Buttons ===== */
.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  padding: 8px 16px;
  background: var(--white);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--primary-light);
}

.btn-cancel {
  width: 100%;
  padding: 12px;
  background: var(--white);
  color: var(--text-light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: var(--secondary);
  border-color: #ccc;
}

/* ===== Permissions List ===== */
.permissions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  transition: box-shadow 0.15s;
}

.permission-item:hover {
  box-shadow: var(--shadow);
}

.permission-info {
  flex: 1;
}

.permission-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.permission-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  margin-top: 3px;
}

.permission-role-badge.read {
  background: #E8F5E9;
  color: #2E7D32;
}

.permission-role-badge.write {
  background: #E3F2FD;
  color: #1565C0;
}

.btn-remove {
  padding: 5px 12px;
  background: var(--white);
  color: var(--danger);
  border: 1.5px solid var(--danger);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

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

/* ===== Add Permission Panel ===== */
.add-permission-panel {
  background: var(--secondary);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 10px;
  border: 1px solid var(--border);
}

.selected-perm-user {
  margin-top: 12px;
}

.role-select {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.role-select label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.role-select select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  background: var(--white);
  color: var(--text);
  transition: border 0.2s;
}

.role-select select:focus {
  border-color: var(--primary);
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-content {
  background: var(--white);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.modal-content h3 {
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}

.meeting-types {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.meeting-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s;
  flex: 1;
}

.meeting-type-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.meeting-icon {
  font-size: 26px;
}

/* ===== Form Group ===== */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  background: var(--secondary);
  color: var(--text);
  transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.form-group textarea {
  height: 80px;
  resize: vertical;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

/* ===== Side Panel ===== */
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background: var(--white);
  z-index: 500;
  display: flex;
  flex-direction: column;
}

.side-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.side-panel-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--text);
}

/* ===== Request Items ===== */
.request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  margin-bottom: 8px;
}

.request-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.request-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.request-email {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 1px;
}

.request-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  margin-top: 3px;
}

.request-role-badge.read {
  background: #E8F5E9;
  color: #2E7D32;
}

.request-role-badge.write {
  background: #E3F2FD;
  color: #1565C0;
}

.request-actions {
  display: flex;
  gap: 6px;
}

.btn-approve {
  padding: 5px 12px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.btn-approve:hover {
  opacity: 0.85;
}

.btn-reject {
  padding: 5px 12px;
  background: var(--white);
  color: var(--danger);
  border: 1.5px solid var(--danger);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

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

/* ===== Status Badge ===== */
.request-status-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}

.status-badge.pending {
  background: #FFF3E0;
  color: #E65100;
}

.status-badge.approved {
  background: #E8F5E9;
  color: #2E7D32;
}

.status-badge.rejected {
  background: #FFEBEE;
  color: #C62828;
}

.btn-delete-req {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 2px;
}

.btn-delete-req:hover {
  opacity: 1;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-light);
  font-size: 13px;
}

.empty-state-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

/* ===== Loading ===== */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 2000;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading span {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 20px;
  right: 16px;
  left: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  z-index: 3000;
  animation: slideUp 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

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

.toast.error {
  background: var(--danger);
  color: var(--white);
}

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

/* ===== Divider ===== */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ===== Utilities ===== */
.hidden {
  display: none !important;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
  background: #ccc;
}

.duration-select {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  margin-bottom: 12px;
  cursor: pointer;
}

.user-title {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 1px;
}

.meeting-type-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 8px;
}

.meeting-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  padding: 16px 12px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100px;
}

.meeting-type-btn:hover {
  border-color: #F5A623;
  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.2);
}

.meeting-type-btn span {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  font-family: Arial, sans-serif;
}