
/* ==========================================
   QRental - Midnight Blue Premium Theme
   관리자 PC / 사용자 모바일 반응형 디자인
   기존 JavaScript 기능 유지
========================================== */

/* 01. 기본 색상과 설정 */

:root {
  --bg: #202936;
  --sidebar: #263342;
  --panel: #303d4d;
  --panel-hover: #374759;
  --border: #48586b;

  --text: #f4f7fa;
  --muted: #b4c1d1;

  --accent: #86b7f2;
  --accent-hover: #a5ceff;

  --green: #92dfb5;
  --red: #ff989f;
  --yellow: #ffd28a;

  --input-bg: #263443;
  --shadow: 0 12px 32px rgba(8, 17, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Malgun Gothic",
               "Apple SD Gothic Neo", Arial, sans-serif;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 02. 관리자 레이아웃 */

.app-layout {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 28px 18px;

  display: flex;
  flex-direction: column;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;

  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.7px;
}

.logo-icon,
.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;

  display: grid;
  place-items: center;

  background: var(--accent);
  color: #17283b;

  font-size: 22px;
  font-weight: 900;
}

.logo-dot {
  color: var(--accent);
}

.sidebar-label {
  padding-left: 12px;
  color: #90a6c2;

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: -18px;
}

.side-nav a {
  padding: 13px 15px;
  border-radius: 12px;

  color: var(--muted);
  font-size: 13px;
  font-weight: 600;

  transition: background 0.2s, color 0.2s;
}

.side-nav a:hover,
.side-nav a.active {
  background: #3a5069;
  color: #bddbff;
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-note {
  padding: 15px;
  background: #304155;
  border: 1px solid var(--border);
  border-radius: 13px;

  font-size: 11px;
  font-weight: 800;
}

.sidebar-note p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 400;
}

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;

  background: var(--green);
  border-radius: 50%;
}

.side-link {
  display: block;
  padding: 18px 10px;
  color: var(--accent);
  font-size: 12px;
}

.side-link:hover {
  color: #d4e8ff;
}

.dashboard-content {
  width: 100%;
  max-width: 1550px;
  min-width: 0;
  margin: 0 auto;
  padding: 34px;
}

.shell {
  width: 100%;
  max-width: 1050px;
  margin: auto;
  padding: 28px 22px 55px;
}

/* 03. 상단 헤더 */

.dashboard-topbar,
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.eyebrow {
  display: block;
  color: var(--accent);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
  margin-bottom: 7px;
}

.eyebrow.light {
  color: #c6deff;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 7px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.7px;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: -0.4px;
}

.subtext {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.top-pill,
.demo-label {
  display: inline-flex;
  align-items: center;

  padding: 9px 13px;
  border-radius: 100px;

  background: #294b46;
  color: #b5f2d4;
  border: 1px solid #3e7166;

  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

/* 04. 메인 배너 */

.hero {
  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: 210px;
  padding: 34px;
  margin-bottom: 24px;

  border-radius: 20px;
  border: 1px solid #627b9a;

  background:
    radial-gradient(
      circle at 90% 25%,
      rgba(151, 192, 249, 0.32),
      transparent 48%
    ),
    linear-gradient(
      120deg,
      #344962 0%,
      #52749b 100%
    );

  box-shadow: var(--shadow);
}

.hero h2 {
  position: relative;
  margin-bottom: 10px;

  font-size: clamp(23px, 3vw, 32px);
  line-height: 1.3;
  letter-spacing: -0.9px;
}

.hero p {
  margin-bottom: 18px;
  font-size: 13px;
  color: #d7e6f8;
}

.hero-art {
  flex: none;
  color: rgba(202, 226, 255, 0.26);

  font-size: clamp(90px, 12vw, 150px);
  font-weight: 900;
  line-height: 1;
}

.hero .button {
  width: auto;
}

.user-hero {
  min-height: 180px;
}

/* 05. 통계 카드 */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  padding: 23px;
  border-radius: 18px;

  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);

  transition: transform 0.2s,
              border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: #7294b7;
}

.stat-icon {
  display: grid;
  place-items: center;

  width: 38px;
  height: 38px;
  margin-bottom: 15px;

  border-radius: 12px;
  background: #3b5571;
  color: var(--accent);
  font-size: 19px;
}

.stat-icon.green {
  background: #31574b;
  color: var(--green);
}

.stat-icon.orange {
  background: #455c78;
  color: #bad8ff;
}

.stat-icon.red {
  background: #60404d;
  color: var(--red);
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  margin: 5px 0;
  color: #ffffff;

  font-size: 35px;
  font-weight: 800;
  line-height: 1.2;
}

.stat-card:last-child strong {
  color: var(--red);
}

.stat-card small {
  color: #a3b5c9;
  font-size: 10px;
}

/* 06. 콘텐츠 패널 */

.panel {
  min-width: 0;
  padding: 25px;
  margin-bottom: 24px;

  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.panel:hover {
  border-color: #627b99;
}

.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  margin-bottom: 20px;
}

.section-symbol {
  display: grid;
  place-items: center;

  width: 42px;
  height: 42px;

  border-radius: 12px;
  background: #405770;
  color: #a9d0ff;
  font-size: 21px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 20px;
}

/* 07. 입력창과 폼 */

.form-grid {
  display: grid;
  gap: 16px;
}

label {
  display: block;
  color: #dae5f2;
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  display: block;

  width: 100%;
  min-width: 0;
  margin-top: 8px;
  padding: 13px 14px;

  border-radius: 11px;
  border: 1px solid #52657b;

  background: var(--input-bg);
  color: var(--text);

  font-size: 14px;
  outline: none;
  color-scheme: dark;

  transition: border-color 0.2s,
              box-shadow 0.2s;
}

input::placeholder {
  color: #9aacc0;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(134, 183, 242, 0.17);
}

select option {
  background: var(--input-bg);
  color: var(--text);
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* 08. 버튼 */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 13px 18px;
  border: none;
  border-radius: 11px;

  cursor: pointer;
  text-align: center;

  font-size: 13px;
  font-weight: 800;

  transition: background 0.2s,
              transform 0.2s;
}

.button.primary {
  background: var(--accent);
  color: #17283b;
}

.button.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.form-grid > .button {
  width: 100%;
  min-height: 46px;
}

.button.danger {
  background: #583b49;
  color: #ffc3c7;
  padding: 8px 13px;
  font-size: 12px;
}

.button.danger:hover {
  background: #704756;
}

.button.secondary {
  background: #43576d;
  color: var(--text);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 09. 물품 및 기록 테이블 */

.search-label {
  max-width: 350px;
  margin-bottom: 20px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th {
  padding: 15px 14px;
  background: #263545;
  color: #c1d2e6;

  font-size: 11px;
  font-weight: 800;

  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

th:first-child {
  border-radius: 9px 0 0 0;
}

th:last-child {
  border-radius: 0 9px 0 0;
}

td {
  padding: 16px 14px;

  font-size: 12px;
  color: #e4edf8;

  border-bottom: 1px solid #46576b;
}

tbody tr:hover {
  background: var(--panel-hover);
}

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

/* 10. 대여 상태 배지 */

.badge {
  display: inline-block;

  padding: 5px 11px;
  border-radius: 100px;

  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.available,
.badge.success {
  background: #2d5546;
  color: #b8f5d4;
}

.badge.rented,
.badge.info {
  background: #375576;
  color: #c8e1ff;
}

.badge.overdue,
.badge.danger {
  background: #68424e;
  color: #ffc0c7;
}

.badge.warning {
  background: #65513b;
  color: #ffe4ac;
}

/* 11. 메시지 */

.notice {
  min-height: 20px;
  margin: 14px 0;

  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.notice.error {
  padding: 13px;
  border-radius: 11px;

  color: #ffc0c7;
  background: #593642;
  border: 1px solid #815060;
}

.notice.success {
  color: #b3f1d3;
}

.empty {
  padding: 30px 10px;
  text-align: center;

  color: var(--muted);
  font-size: 13px;
}

footer {
  padding: 17px 0;

  color: #a5b6c9;
  font-size: 11px;
  text-align: center;
  line-height: 1.8;
}

/* 12. 사용자 화면 */

.user-page {
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(113, 162, 222, 0.18),
      transparent 460px
    ),
    var(--bg);
}

.user-shell {
  max-width: 950px;
}

/* 13. 태블릿 */

@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: 185px minmax(0, 1fr);
  }

  .dashboard-content {
    padding: 24px;
  }

  .sidebar {
    padding: 22px 12px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 14. 모바일 */

@media (max-width: 760px) {
  .app-layout {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
    gap: 16px;
  }

  .sidebar-label,
  .sidebar-bottom {
    display: none;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    margin: 0;
    padding-bottom: 3px;
  }

  .side-nav a {
    white-space: nowrap;
    padding: 10px 12px;
  }

  .dashboard-content,
  .shell {
    padding: 17px;
  }

  .dashboard-topbar,
  .topbar {
    gap: 10px;
    margin-bottom: 20px;
  }

  .columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }

  .stat-card {
    padding: 17px;
  }

  .stat-card strong {
    font-size: 28px;
  }

  .hero {
    min-height: 170px;
    padding: 24px;
  }

  .hero-art {
    font-size: 72px;
  }

  .panel {
    padding: 19px;
    margin-bottom: 16px;
  }

  .date-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 21px;
  }

  th,
  td {
    padding: 11px 10px;
  }

  .user-page .form-grid > .button {
    min-height: 52px;
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  .hero-art {
    display: none;
  }

  .top-pill,
  .demo-label {
    padding: 6px 9px;
    font-size: 9px;
  }

  .stat-card strong {
    font-size: 25px;
  }
}

/* 15. 접근성 및 움직임 줄이기 */

:focus-visible {
  outline: 2px solid #bfdcff;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
