:root {
  --primary-color: #059669;
  --primary-hover: #047857;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #ecfdf5 100%);
  --card-bg: rgba(255, 255, 255, 0.95);
  --glass-bg: rgba(255, 255, 255, 0.9);
  --border-color: rgba(203, 213, 225, 0.9);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --accent-color: #10b981;
  --error-color: #ef4444;
  --shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    "Pretendard",
    -apple-system,
    BlinkMacSystemFont,
    system-ui,
    Roboto,
    "Helvetica Neue",
    "Segoe UI",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Malgun Gothic",
    sans-serif;
}

body {
  background: linear-gradient(rgba(226, 232, 240, 0.85), rgba(248, 250, 260, 0.85)), 
              url('https://cdn.crowdpic.net/detail-thumb/thumb_d_BD812B9CA5053678165CECD17C48060B.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 1200px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  transition: transform 0.3s ease;
}

h1,
h2,
h3 {
  font-weight: 700;
  color: #0f172a;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin-bottom: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(to right, var(--primary-color), #34d399);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Authentication */
.login-container {
  max-width: 400px;
  text-align: center;
}

.input-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 1rem;
  transition: all 0.2s;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
  padding-right: 1.8rem !important;
}

.row-input {
  width: 100%;
  padding: 0.5rem 0.4rem;
  border: 1px solid transparent;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 0.9rem;
}

input[type="time"] {
  min-height: 38px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

.btn-delete {
  background: none;
  color: var(--error-color);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}

/* Dashboard Grid - Full Width Work Area */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.log-section {
  width: 100%;
}

.info-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-table th {
  background: #f8fafc;
  padding: 1rem;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid #e2e8f0;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

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

.row-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid transparent;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 0.9rem;
}

.row-input:focus {
  border-color: var(--primary-color);
  background: white;
}

/* List/Checklist Styles */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.checklist-item input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
}

.checklist-item .completed {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Modal/Tab styles */
.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

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

/* Admin Dashboard */
.admin-card {
  border-left: 4px solid var(--primary-color);
}

.team-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* Helper Classes */
.w-full {
  width: 100%;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mb-4 {
  margin-bottom: 1rem;
}

/* Category Tags */
.category-tag {
  background: #ecfdf5;
  color: #065f46;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.category-tag span {
  cursor: pointer;
  color: #059669;
}

/* Calendar Styles */
.mini-calendar {
  flex: 0 0 350px;
  background: white;
  border-radius: 15px;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
}

.cal-header {
  text-align: center;
  margin-bottom: 10px;
  font-weight: 700;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  padding-bottom: 5px;
}

.cal-date {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 8px;
}

.cal-date:hover {
  background: #f1f5f9;
}

.cal-date.active {
  background: var(--primary-color);
  color: white;
}

.cal-date.has-log::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  background: #10b981;
  border-radius: 50%;
  bottom: 2px;
}

/* Navigation Buttons */
.nav-btn {
  background: #f1f5f9;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover {
    background: #e2e8f0;
}

.date-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#date-jump {
    margin-top: 5px;
    padding: 3px 8px;
    font-size: 11px;
    border: none;
    background: #f8fafc;
    color: #94a3b8;
    border-radius: 4px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

@media print {
  .btn,
  .tabs,
  .header,
  .top-info-area {
    display: none !important;
  }
  .glass-card {
    box-shadow: none;
    border: 1px solid #000;
    margin: 0;
    padding: 0;
  }
}

/* --- Mobile Responsive Design --- */
@media screen and (max-width: 768px) {
  body {
    padding: 1rem;
  }

  .glass-card {
    padding: 1.25rem;
    margin-bottom: 1rem;
  }

  .header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .tabs {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .tab {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    flex: 1 1 calc(50% - 0.5rem);
    text-align: center;
  }

  /* Date Navigation Mobile */
  .calendar-nav {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .date-selector h1 {
    font-size: 1.4rem;
  }

  /* Top Info Area Stack */
  .top-info-area {
    flex-direction: column !important;
    gap: 15px;
  }

  .monthly-tasks-card,
  .mini-calendar {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Table Mobile-Friendly (Horizontal scroll) */
  .log-section {
    width: 100%;
    overflow-x: auto;
  }

  .data-table {
    min-width: 600px; /* Ensure table doesn't squish too much */
  }

  .data-table th, .data-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }

  .row-input {
    font-size: 0.85rem;
    padding: 4px;
  }

  #today-date {
    font-size: 1.2rem;
  }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Admin Grid */
  #admin-dashboard-content > div {
    grid-template-columns: 1fr !important;
  }
}
