/* Base Reset & Variables */
:root {
  --bg-color: #f7f9fa;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
  --text-main: #2d3436;
  --text-sub: #636e72;
  --accent-red: #ff4757;
  --accent-red-hover: #ff6b81;
  --accent-red-light: rgba(255, 71, 87, 0.1);
  --border-light: #dfe6e9;
  --border-hover: #b2bec3;
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Classes */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
}

/* Screens */
.screen {
  display: none;
  opacity: 0;
  transition: var(--transition);
}

.screen.active {
  display: flex;
  opacity: 1;
}

/* Auth / Login */
#login-screen {
  height: 100vh;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  text-align: center;
  animation: slideUp 0.6s ease;
}

.login-card h1 {
  font-weight: 600;
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--accent-red);
}

.login-card p {
  color: var(--text-sub);
  font-size: 14px;
  margin-bottom: 30px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-card input {
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
  background: #fff;
}

.login-card input:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px var(--accent-red-light);
}

.divider {
  margin: 25px 0;
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--border-hover);
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-light);
}

.divider span {
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.primary {
  background-color: var(--accent-red);
  color: #fff;
}

.btn.primary:hover {
  background-color: var(--accent-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-red-light);
}

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

.btn.text-btn {
  background: transparent;
  color: var(--text-sub);
}
.btn.text-btn:hover {
  color: var(--accent-red);
  background: var(--accent-red-light);
}

.error-msg {
  color: var(--accent-red);
  font-size: 13px;
  margin-top: 15px;
  min-height: 20px;
}

/* Dashboard Layout */
#dashboard-screen {
  display: none;
  height: 100vh;
  width: 100vw;
  flex-direction: row;
  overflow: hidden;
}

#dashboard-screen.active {
  display: flex;
}

/* Sidebar */
.sidebar {
  width: 260px;
  margin: 20px 0 20px 20px;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.sidebar .logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  padding: 0 20px 30px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
}
.sidebar .logo::after {
  content: ".uz";
  color: var(--accent-red);
}

.sidebar nav {
  flex: 1;
}

.sidebar ul {
    list-style: none;
    flex-grow: 1;
}

.nav-section-title {
    color: var(--text-sub);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    margin: 15px 0 5px 20px;
    letter-spacing: 0.05em;
}

.sidebar li {
  padding: 12px 20px;
  margin: 5px 15px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-sub);
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.sidebar li:hover {
  background: var(--accent-red-light);
  color: var(--accent-red);
  transform: translateX(4px);
}

.sidebar li.active {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-red-light);
}

.sidebar-bottom {
  padding: 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#user-display {
  font-weight: 600;
  font-size: 14px;
}

/* Main Content Area */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.topbar {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.topbar h2 {
  font-weight: 500;
  font-size: 20px;
}

.page-container {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: var(--text-sub);
  font-size: 15px;
  animation: fadeIn 0.4s ease;
}

/* Tables */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}
.table-toolbar input.search-input {
  flex: 1;
  max-width: 350px;
}

/* Premium Glassy Inputs Globally */
input, select, .search-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

input:focus, select:focus, .search-input:focus {
  background: #fff;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 4px var(--accent-red-light);
  transform: translateY(-1px);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%237D879C%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat, repeat;
  background-position: right .7em top 50%, 0 0;
  background-size: .65em auto, 100%;
}

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

thead th {
  padding: 15px;
  font-weight: 600;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  user-select: none;
}

thead th.sortable {
  cursor: pointer;
  transition: color 0.2s;
}

thead th.sortable:hover {
  color: var(--accent-red);
}

thead th.sortable::after {
  content: '↕';
  margin-left: 5px;
  opacity: 0.3;
}

thead th.sortable.sort-asc::after {
  content: '↑';
  opacity: 1;
  color: var(--accent-red);
}

thead th.sortable.sort-desc::after {
  content: '↓';
  opacity: 1;
  color: var(--accent-red);
}

tbody td {
  padding: 15px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  vertical-align: middle;
}

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

tbody tr:hover {
  background-color: #fafbfc;
  transform: translateY(-1px);
}

/* Pagination Controls */
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  margin-top: 10px;
  border-top: 1px solid var(--border-light);
}

.table-footer .rows-select {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-sub);
  font-size: 14px;
}

.table-footer .rows-select select {
  width: auto;
  padding: 6px 30px 6px 12px;
}

.pagination {
  display: flex;
  gap: 5px;
  align-items: center;
}

.page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-light);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 14px;
  transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.page-btn.active {
  background: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  margin: 0 10px;
  font-size: 14px;
  color: var(--text-sub);
}

/* Animations */
@keyframes slideUp {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Utilities */
.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.status-badge.active {
  background: #e3fcef;
  color: #0d8246;
}
.status-badge.inactive {
  background: #ffe3e3;
  color: var(--accent-red);
}
