* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: white;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
}

.sidebar-header i {
    color: #666;
    margin-right: 10px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
    font-size: 14px;
}

.sidebar-menu a:hover {
    background-color: #f8f9fa;
}

.sidebar-menu a.active {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
}

.sidebar-menu .menu-icon {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.sidebar-menu .menu-number {
    margin-right: 10px;
    font-weight: bold;
    color: #666;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    /* ✅ đặt hàng ngang: sidebar | content */
    overflow: hidden;
}

/* Navbar */
.navbar {
    background-color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}


.navbar-left {
    display: flex;
    align-items: center;
}

.navbar-left i {
    color: #666;
    cursor: pointer;
    margin-right: 15px;
}

.navbar-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-right i {
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.navbar-right i:hover {
    background-color: #f8f9fa;
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Form Container */
.form-section {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.form-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

/* Calendar Section */
.calendar-section {
    width: 285px;
    background-color: white;
    border-left: 1px solid #ddd;
    padding: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.calendar-header {
    background-color: #ed1c2e;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}

.calendar {
    padding: 20px;
    flex: 1;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-nav button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
    color: #333;
}

.calendar-nav button:hover {
    background-color: #f8f9fa;
}

.calendar-nav .month-year {
    font-weight: bold;
    font-size: 14px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 20px;
    width: 100%;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: 2px;
    min-height: 28px;
}

.calendar-day.header {
    background-color: #f8f9fa;
    font-weight: bold;
    cursor: default;
    color: #666;
}

.calendar-day.today {
    background-color: #ed1c2e;
    color: white;
    font-weight: bold;
}

.calendar-day.other-month {
    color: #ccc;
}

.calendar-day:hover:not(.header):not(.today) {
    background-color: #f0f0f0;
}

.upcoming-events {
    padding: 0 20px 20px 20px;
    border-top: 1px solid #f0f0f0;
    flex: 1;
}

.upcoming-events h4 {
    color: #333;
    margin: 15px 0;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.4;
}

.event-item {
    background-color: #f8f9fa;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 12px;
}

.event-date {
    color: #666;
    font-weight: bold;
}

.event-title {
    color: #333;
    margin-top: 5px;
}

/* Form Styles */
.form-row {
    display: flex;
    margin-bottom: 15px;
    gap: 15px;
    align-items: flex-start;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.required {
    color: #dc3545;
}

input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007bff;
}

select {
    background-color: white;
    cursor: pointer;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group input {
    flex: 1;
}

.scan-btn {
    color: white;
    border: none;
    padding: 3px 1px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.scan-btn:hover {
    background-color: #ccc;
}

.currency-input {
    position: relative;
}

.currency-input::after {
    content: "triệu đ/th";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #dc3545;
    font-size: 12px;
    pointer-events: none;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

.address-section {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.address-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.info-text {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

.submit-btn {
    background-color: #ed1c2e;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #c41e3a;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-menu span {
        display: none;
    }

    .calendar-section {
        display: none;
    }

    .form-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* Popup overlay */
#json-popup-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
}

/* Popup container */
#json-popup-container {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  padding: 24px 30px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.2s ease-in-out;
}

/* Title */
#json-popup-container h3 {
  margin-top: 0;
  font-size: 20px;
  font-weight: bold;
  color: #111;
  margin-bottom: 18px;
}

/* Line format */
.json-popup-line {
  display: flex;
  margin-bottom: 12px;
}

/* Key (label) */
.json-popup-key {
  font-weight: 600;
  color: #333;
  width: 140px;
  flex-shrink: 0;
  margin-right: 30px;
}

/* Value */
.json-popup-value {
  color: #007BFF;
  font-weight: 500;
  word-break: break-word;
}

/* Close button */
.json-popup-close-button {
  margin-top: 10px;
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.json-popup-close-button:hover {
  background-color: #a71d2a;
}

/* Fade animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -45%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.json-popup-button {
    padding: 10px 20px;
    background-color: #007BFF;
    color: white;
    border-radius: 8px;
    border: none;
}

.json-popup-button:hover {
    background-color: #0056b3;
    cursor: pointer;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007BFF;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

label.required-field::after {
  content: ' *';
  color: red;
}

