/* Import Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  --primary-color: #127b8e;
  --primary-hover: #0e6474;
  --dark-bg: #23242b;
  --darker-bg: #1c1d22;
  --light-bg: #f4f7f6;
  --card-bg: #ffffff;
  --text-dark: #333333;
  --text-muted: #666666;
  --text-light: #ffffff;
  --border-color: #e1e4e8;
  --success: #00cf22;
  --danger: #cf0000;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 15px 30px rgba(0, 0, 0, 0.15);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Inter", arial, sans-serif;
}

body {
  background-color: var(--light-bg);
  color: var(--text-dark);
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: var(--dark-bg);
  color: var(--text-light);
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 10;
}

.u-name {
  font-size: 22px;
  font-weight: 700;
  padding-left: 17px;
  letter-spacing: 1px;
}

.u-name b {
  color: var(--primary-color);
}

.header i {
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.3s ease;
}

.header .notification {
  position: relative;
  cursor: pointer;
}

.header .notification span {
  position: absolute;
  top: -2px;
  right: -5px;
  background: var(--danger);
  padding: 2px 5px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
  border: 2px solid var(--dark-bg);
}

.header .notification span:empty {
  display: none;
}

.header .notification:hover i {
  color: var(--primary-color);
}

/* Notification Bar */
.notification-bar {
  display: none;
  width: 100%;
  max-width: 320px;
  position: absolute;
  right: 20px;
  top: 70px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 20;
}

.notification-bar ul li {
  list-style: none;
  border-bottom: 1px solid var(--border-color);
}

.notification-bar ul li:last-child {
  border-bottom: none;
}

.notification-bar ul li a {
  text-decoration: none;
  color: var(--text-dark);
  display: block;
  padding: 12px 15px;
  transition: background 0.3s;
  font-size: 14px;
}

.notification-bar ul li a:hover {
  background: var(--light-bg);
}

.open-notification {
  display: block;
}

/* Sidebar */
.side-bar {
  width: 280px;
  background: var(--dark-bg);
  min-height: calc(100vh - 65px);
  /* Adjusted */
  transition: 0.4s width cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 5;
}

.body {
  display: flex;
}

.user-p {
  text-align: center;
  padding: 30px 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-p img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
  padding: 3px;
  background: #fff;
  object-fit: cover;
}

.user-p h4 {
  color: var(--text-light);
  padding: 10px 0 5px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.side-bar ul {
  margin-top: 15px;
  list-style: none;
}

.side-bar ul li {
  font-size: 15px;
  transition: all 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  margin: 4px 12px;
  border-radius: var(--radius-md);
}

.side-bar ul li:hover {
  background: rgba(18, 123, 142, 0.15);
  /* light teal hover */
}

.side-bar ul li a {
  text-decoration: none;
  color: var(--text-light) !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 12px 15px;
  font-weight: 500;
}

.side-bar .active {
  background: var(--primary-color) !important;
}

.side-bar .active a {
  color: #fff !important;
}

.side-bar .active a i {
  color: #fff;
}

.side-bar ul li a i {
  display: inline-block;
  width: 30px;
  font-size: 20px;
  color: #888;
  transition: color 0.3s;
}

.side-bar ul li:hover a i {
  color: var(--primary-color);
}

.side-bar .active:hover a i {
  color: #fff;
}

#navbtn {
  display: inline-block;
  margin-left: 20px;
  font-size: 22px;
  transition: 0.3s;
}

#checkbox {
  display: none;
}

#checkbox:checked ~ .body .side-bar {
  width: 80px;
}

#checkbox:checked ~ .body .side-bar .user-p {
  padding: 20px 0;
}

#checkbox:checked ~ .body .side-bar .user-p img {
  width: 50px;
  height: 50px;
}

#checkbox:checked ~ .body .side-bar .user-p h4 {
  display: none;
}

#checkbox:checked ~ .body .side-bar a span {
  display: none;
}

#checkbox:checked ~ .body .side-bar ul li a {
  justify-content: center;
  padding: 15px 0;
}

#checkbox:checked ~ .body .side-bar ul li a i {
  width: auto;
  margin: 0;
}

/* Sections & Content */
.section-1 {
  padding: 30px 40px;
  width: 100%;
  flex-grow: 1;
}

.section-1 .title,
.section-1 .title-2 {
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.section-1 h2,
.section-1 h3,
.section-1 h4 {
  color: var(--dark-bg);
  font-weight: 600;
  font-size: 24px;
}

/* Buttons */
.btn,
.edit-btn,
.delete-btn,
.section-1 .title a,
.section-1 .title-2 .btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 10px 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.5px;
}

.btn:hover,
.edit-btn:hover,
.delete-btn:hover,
.section-1 .title a:hover,
.section-1 .title-2 .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  opacity: 0.95;
}

.section-1 .title a,
.section-1 .title-2 .btn {
  background: var(--success);
}

.section-1 .title a:hover,
.section-1 .title-2 .btn:hover {
  background: #00b31e;
}

.edit-btn {
  background: #2364a1;
  padding: 8px 15px;
  font-size: 13px;
}

.edit-btn:hover {
  background: #1c5285;
}

.delete-btn {
  background: var(--danger);
  padding: 8px 15px;
  font-size: 13px;
}

.delete-btn:hover {
  background: #b30000;
}

/* View Toggles */
.section-1 .title-2 a {
  display: inline-block;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--card-bg);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
}

.section-1 .title-2 a:hover {
  background: var(--light-bg);
  color: var(--text-dark);
}

.section-1 .title-2 a.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 4px 6px rgba(18, 123, 142, 0.2);
}

/* Tables */
.main-table {
  width: 100%;
  margin-top: 20px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border-collapse: collapse;
}

.main-table thead {
  background-color: #f8fafc;
  border-bottom: 2px solid var(--border-color);
}

.main-table,
.main-table tr,
.main-table th,
.main-table td {
  border: none;
}

.main-table th {
  padding: 15px 20px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.main-table td {
  padding: 15px 20px;
  color: var(--text-dark);
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.main-table tbody tr {
  transition: background 0.2s ease;
}

.main-table tbody tr:hover {
  background-color: #f8fafc;
}

.main-table tbody tr:last-child td {
  border-bottom: none;
}

/* Forms */
.form-1 {
  width: 100%;
  max-width: 550px;
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-top: 20px;
}

.input-holder {
  margin-bottom: 20px;
}

.input-holder label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 14px;
  margin-bottom: 8px;
}

.input-1 {
  border: 1px solid var(--border-color);
  width: 100%;
  padding: 12px 15px;
  font-size: 14px;
  outline: none;
  border-radius: var(--radius-md);
  background-color: #fcfcfc;
  transition: all 0.3s ease;
  font-family: inherit;
}

.input-1:focus {
  border-color: var(--primary-color);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(18, 123, 142, 0.15);
}

textarea.input-1 {
  resize: vertical;
  min-height: 120px;
}

/* Alerts */
.danger,
.success {
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.danger {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.success {
  background: #dcfce7;
  color: #166534;
  border-left: 4px solid #22c55e;
}

/* Dashboard Cards */
.dashboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  width: 100%;
  margin-top: 20px;
}

.dashboard-item {
  text-align: center;
  background-color: var(--card-bg);
  padding: 30px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.dashboard-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-color);
  opacity: 0.8;
}

.dashboard-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.dashboard-item i {
  color: var(--primary-color);
  font-size: 32px;
  margin-bottom: 15px;
  background: rgba(18, 123, 142, 0.1);
  width: 65px;
  height: 65px;
  line-height: 65px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.dashboard-item:hover i {
  background: var(--primary-color);
  color: #fff;
  transform: scale(1.1);
}

.dashboard-item span {
  color: var(--text-dark);
  font-size: 16px;
  font-weight: 600;
}

.dashboard-item span span {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 5px;
  font-weight: 400;
}

/* Login Page Specific Styling */
.login-body {
  background: var(--light-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card,
.login-container {
  background: var(--card-bg);
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin: auto;
}

.login-header {
  background: var(--dark-bg);
  padding: 35px 20px;
  text-align: center;
  border-bottom: 4px solid var(--primary-color);
}

.login-header .u-name {
  font-size: 24px;
  padding: 0;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.login-form-container {
  padding: 35px 30px;
}

.company-info-box {
  background-color: rgba(18, 123, 142, 0.05);
  border-left: 4px solid var(--primary-color);
  padding: 15px;
  margin-bottom: 25px;
  font-size: 13.5px;
  text-align: left;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-dark);
}

.input-group-custom {
  margin-bottom: 20px;
}

.input-group-custom label {
  display: block;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-login {
  background: var(--primary-color);
  color: #fff;
  border: none;
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 10px;
  box-shadow: var(--shadow-sm);
}

.btn-login:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(18, 123, 142, 0.3);
}
.spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
}

.spinner::after {
  content: "";
  width: 50px;
  height: 50px;
  border: 5px solid #ccc;
  border-top: 5px solid #1572bd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none;
}
/* Responsive Layout Constraints */

/* 1. Mobile-first (upward scaling) */
@media (min-width: 768px) {
  .dashboard {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 2. Desktop-first (downward overrides) */
@media (max-width: 992px) {
  .side-bar {
    width: 240px;
  }

  .section-1 {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .side-bar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100vh;
    z-index: 1000;
  }

  #checkbox:checked ~ .body .side-bar {
    left: 0;
    width: 280px;
  }

  #checkbox:checked ~ .body .side-bar .user-p {
    display: block;
    padding: 30px 10px 20px;
  }

  #checkbox:checked ~ .body .side-bar .user-p h4 {
    display: block;
  }

  #checkbox:checked ~ .body .side-bar a span {
    display: inline;
  }

  #checkbox:checked ~ .body .side-bar ul li a {
    justify-content: flex-start;
    padding: 12px 15px;
  }

  #checkbox:checked ~ .body .side-bar ul li a i {
    width: 30px;
    margin-right: 0;
  }

  .body {
    margin-left: 0;
  }

  #checkbox:checked ~ .body {
    margin-left: 0;
  }

  .form-1 {
    padding: 20px;
  }

  /* Responsive Table Cards */
  .main-table,
  .main-table thead,
  .main-table tbody,
  .main-table th,
  .main-table td,
  .main-table tr {
    display: block;
  }

  .main-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .main-table tr {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
  }

  .main-table td {
    border: none;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 50% !important;
    text-align: right;
    min-height: 50px;
  }

  .main-table td:last-child {
    border-bottom: none;
  }

  .main-table td:before {
    content: attr(data-label);
    position: absolute;
    left: 15px;
    top: 15px;
    /* Aligns with padding */
    width: calc(50% - 25px);
    padding-right: 10px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 15px;
  }

  .u-name {
    font-size: 18px;
    padding-left: 5px;
  }

  .section-1 {
    padding: 15px;
  }
}
