/* ============================================================
   Базовые переменные и сброс
   ============================================================ */
:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --success: #2ec4b6;
  --danger: #e63946;
  --warning: #f77f00;
  --info: #7209b7;
  --dark: #1d1d2c;
  --gray: #6c757d;
  --light: #f8f9fa;
  --white: #ffffff;
  --border: #dee2e6;
  --shadow: 0 2px 12px rgba(0, 0, 0, .08);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: .25s ease;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  background: var(--dark);
  color: var(--white);
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
}

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

.nav-links a {
  color: rgba(255, 255, 255, .85);
  font-size: .95rem;
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--white);
}

.nav-user {
  color: var(--success);
  font-weight: 600;
  font-size: .9rem;
}

.nav-admin {
  background: var(--warning);
  color: var(--white) !important;
  padding: .3rem .7rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
}

/* ============================================================
   Container
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  flex: 1;
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
  padding: .8rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .95rem;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  padding: .6rem 1.4rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
}

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

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

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

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

.btn-sm {
  padding: .3rem .8rem;
  font-size: .82rem;
}

.btn-block {
  display: block;
  width: 100%;
}

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

.form-group label {
  display: block;
  margin-bottom: .3rem;
  font-weight: 600;
  font-size: .9rem;
  color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .6rem .9rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  transition: border-color var(--transition);
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.form-inline .form-group {
  margin-bottom: 0;
}

.form-hint {
  font-size: .8rem;
  color: var(--gray);
}

/* ============================================================
   Auth
   ============================================================ */
.auth-wrapper {
  display: flex;
  justify-content: center;
  padding: 3rem 1rem;
}

.auth-card {
  background: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 440px;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
}

.auth-link {
  text-align: center;
  margin-top: 1.2rem;
  font-size: .9rem;
}

.form-group-admin {
  background: #fff8e1;
  padding: .8rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--warning);
}

.form-group-admin label {
  margin-bottom: .4rem;
}

.hint {
  font-weight: 400;
  color: var(--gray);
  font-size: .82rem;
}

/* ============================================================
   Rooms Grid
   ============================================================ */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.room-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.room-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.room-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.room-image-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.room-body {
  padding: 1.2rem;
}

.room-body h3 {
  margin-bottom: .4rem;
  font-size: 1.2rem;
}

.room-desc {
  color: var(--gray);
  font-size: .9rem;
  margin-bottom: .8rem;
}

.room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  font-size: .82rem;
  color: var(--gray);
  margin-bottom: 1rem;
}

/* ============================================================
   Booking
   ============================================================ */
.book-wrapper {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.book-card {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 600px;
}

.book-card h2 {
  margin-bottom: .5rem;
}

.book-card .room-desc {
  color: var(--gray);
  margin-bottom: 1.5rem;
}

/* ============================================================
   Availability slots
   ============================================================ */
.availability-box {
  background: var(--light);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.availability-box h4 {
  font-size: .95rem;
  margin-bottom: .6rem;
}

.slots-container {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  max-height: 200px;
  overflow-y: auto;
}

.slot-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .6rem;
  background: var(--white);
  border-radius: 6px;
  font-size: .85rem;
}

.slot-free {
  background: #d4edda;
  color: #155724;
}

.slot-busy {
  background: #f8d7da;
  color: #721c24;
}

/* ============================================================
   Calendar
   ============================================================ */
.calendar-filters {
  background: var(--white);
  padding: 1.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.calendar-item {
  background: var(--white);
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
}

.calendar-time {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.calendar-room {
  font-weight: 600;
  margin-top: .2rem;
}

.calendar-user,
.calendar-purpose {
  font-size: .88rem;
  color: var(--gray);
  margin-top: .15rem;
}

/* ============================================================
   Dashboard
   ============================================================ */
.dashboard-section {
  margin-top: 2rem;
}

.dashboard-section h2 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.booking-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.booking-card {
  background: var(--white);
  padding: 1.2rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--success);
}

.booking-card.past {
  opacity: .6;
  border-left-color: var(--gray);
}

.booking-info h3 {
  margin-bottom: .3rem;
}

.booking-info p {
  font-size: .9rem;
  color: var(--gray);
}

/* ============================================================
   Admin
   ============================================================ */
.admin-section {
  margin-top: 2rem;
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-section h2 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.table th,
.table td {
  padding: .7rem .8rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: var(--light);
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  color: var(--gray);
}

.table tr:hover {
  background: #f0f4ff;
}

.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-danger {
  background: #f8d7da;
  color: #721c24;
}

.badge-admin {
  background: #fff3cd;
  color: #856404;
}

.badge-user {
  background: #d1ecf1;
  color: #0c5460;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--gray);
  font-size: .85rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* ============================================================
   Utility
   ============================================================ */
.text-muted {
  color: var(--gray);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .nav-container {
    flex-direction: column;
    height: auto;
    padding: .8rem 0;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .booking-card {
    flex-direction: column;
    gap: .8rem;
    align-items: flex-start;
  }

  .table {
    font-size: .8rem;
  }

  .table th,
  .table td {
    padding: .5rem .4rem;
  }
}

.btn-request-release {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    background-color: #f59e0b; 
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.btn-request-release:hover {
    background-color: #d97706;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.btn-request-release:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.2);
}

.btn-request-release:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.btn-request-release:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}