/*
The CSS file contains all the styling for 
the planner web application. It includes
styles for login page, dashboard page, calendar page, task page
lists page, pomodoro timer page, notebooks, and even for other 
features. The design uses flexbox for flexible
layouts. It also uses CSS Grid for organized content grids, 
and includes responsive design with media queries 
to work well on tablets and mobile phones and for other screen sizes.
*/

body {
  font-family: Arial, sans-serif;
  margin: 0;
  background-color: #ffffff;
}

.body-app {
  background: #f9f6f4;
  min-height: 100vh;
}

.body-auth {
  background: #f1f3f4;
}

.title {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 30px;
  font-family: "Rampart One", sans-serif;
  font-weight: 400;
  font-size: 2.5rem;
  color: #4b3832;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.hidden {
  display: none !important;
}

.text-muted {
  color: #aaa;
}

.text-center {
  text-align: center;
}

.margin-top-lg {
  margin-top: 32px;
}


.login-theme {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f1f3f4;
  margin: 0;
  padding: 40px;
  box-sizing: border-box;
}

.login-card {
  display: flex;
  width: 100%;
  max-width: 950px;
  min-height: 550px;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.auth-form {
  flex: 0 0 50%;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.auth-image {
  flex: 0 0 50%;
  background-color: #fff4e6;
  background-image: url('../visual_assets/login_image.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.input-group {
  width: 100%;
  margin-bottom: 25px;
}

input {
  width: 100%;
  padding: 14px;
  margin: 12px 0;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
}

.button-group {
  display: flex;
  gap: 15px;
  width: 100%;
}

button {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.btn-primary {
  background: #4b3832;
  color: white;
}

.btn-secondary {
  background: white;
  color: #4b3832;
  border: 1px solid #4b3832;
}

.btn-primary:hover {
  background: #6b534b;
  box-shadow: 0 4px 8px rgba(75,56,50,0.3);
}

.btn-secondary:hover {
  background: #fffaf9;
}


.main-header {
  background-color: #4b3832;
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 70px;
  flex-wrap: wrap;
}

.logo {
  flex: 1;
  display: flex;
  justify-content: flex-start;
}

.logo-text {
  font-family: "Rampart One", sans-serif;
  color: white;
  margin: 0;
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 35px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-links li {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  display: flex;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: #fff4e6;
  background: transparent;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 5px 0;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #be9b7b;
}

.nav-links a.active {
  border-bottom: 2px solid #fff4e6;
}

.user-actions {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.btn-logout-nav {
  background: #854442;
  color: #be9b7b;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.85rem;
  transition: opacity 0.3s ease;
  flex: none;
  width: auto;
}

.btn-logout-nav:hover {
  opacity: 0.8;
}


.content-wrapper {
  display: flex;
  flex-direction: column;
}

.layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar-system {
  display: flex;
  height: 100%;
  z-index: 10;
}

.icon-rail {
  width: 72px;
  background-color: #ffffff;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 15px;
  gap: 15px;
}

.rail-btn {
  background: transparent;
  border: none;
  color: #666;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
  width: 60px;
  flex: none;
}

.rail-btn:hover,
.rail-btn.active {
  background-color: #f1f3f4;
  color: #4b3832;
}

.rail-btn span {
  font-size: 0.75rem;
  margin-top: 5px;
  font-weight: bold;
}

.sidebar-panel {
  width: 300px;
  background-color: #fafafa;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  padding: 25px;
  transition: width 0.3s ease, padding 0.3s ease;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-panel.collapsed {
  width: 0;
  padding: 25px 0;
  border-right: none;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.toggle-btn {
  background: transparent;
  border: none;
  color: #4b3832;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  flex: none;
  width: auto;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.sidebar-panel.collapsed .sidebar-content {
  opacity: 0;
  visibility: hidden;
}

.add-task-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.add-task-form input {
  margin: 0;
}

ul {
  list-style: none;
  padding: 0;
  margin-top: 20px;
  flex-grow: 1;
  overflow-y: auto;
}

li {
  padding: 15px;
  margin-bottom: 10px;
  background-color: #ffffff;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-date {
  color: #666;
  font-size: 0.85rem;
}

.btn-task-delete {
  background: transparent;
  border: none;
  color: #ea4335;
  font-weight: bold;
  cursor: pointer;
  flex: none;
  width: auto;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 1rem;
  transition: opacity 0.2s ease;
}

.btn-task-delete:hover {
  opacity: 0.7;
}


.calendar-container {
  flex: 1;
  padding: 30px;
  background-color: #ffffff;
  min-width: 0;
}

#calendar {
  height: 100%;
  min-height: 500px;
}

.fc {
  color: #3c2f2f;
}
.fc .fc-toolbar-title {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif !important;
  color: #4b3832 !important;
  font-weight: 600;
}

.fc .fc-button-primary {
  background-color: #4b3832 !important;
  border-color: #4b3832 !important;
  color: #fff4e6 !important;
  text-transform: capitalize;
  font-family: Arial, sans-serif;
}

.fc .fc-button-primary:hover,
.fc .fc-button-primary:active,
.fc .fc-button-primary:focus {
  background-color: #382924 !important;
  border-color: #382924 !important;
  box-shadow: none !important;
}

.fc .fc-button-primary:disabled {
  background-color: #6a534b !important;
  border-color: #6a534b !important;
}


.home-container {
  padding: 50px 60px;
  max-width: 1100px;
  margin: 0 auto;
}

.home-greeting {
  font-family: "Rampart One", sans-serif;
  font-size: 2rem;
  color: #4b3832;
  margin-bottom: 8px;
}

.home-subtitle {
  color: #888;
  margin-bottom: 40px;
  font-size: 1rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: #fff;
  border: 1px solid #ede8e4;
  border-radius: 16px;
  padding: 32px 28px;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(75,56,50,0.12);
  border-color: #be9b7b;
}

.feature-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-card-icon svg {
  width: 26px;
  height: 26px;
}

.bg-calendar {
  background: #fff4e6;
}

.bg-lists {
  background: #e8f5e9;
}

.bg-notebooks {
  background: #e3f2fd;
}

.bg-pomodoro {
  background: #fce4ec;
}

.bg-analytics {
  background: #f3e5f5;
}

.icon-brown {
  stroke: #4b3832;
}

.icon-green {
  stroke: #2e7d32;
}

.icon-blue {
  stroke: #1565c0;
}

.icon-red {
  stroke: #c62828;
}

.icon-purple {
  stroke: #6a1b9a;
}

.feature-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #4b3832;
}

.feature-card-desc {
  font-size: 0.9rem;
  color: #888;
  line-height: 1.5;
}


.page-container {
  padding: 40px 50px;
  max-width: 1200px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 15px;
}

.page-title {
  font-family: "Rampart One", sans-serif;
  font-size: 1.8rem;
  color: #4b3832;
  margin: 0;
}

.btn-add {
  background: #4b3832;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  transition: background 0.2s ease;
  flex: none;
  width: auto;
}

.btn-add:hover {
  background: #6b534b;
}


.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.gallery-card {
  border: 1px solid #ede8e4;
  border-radius: 12px;
  padding: 24px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
  position: relative;
}

.gallery-card:hover {
  border-color: #be9b7b;
  box-shadow: 0 6px 20px rgba(75,56,50,0.1);
  transform: translateY(-2px);
}

.gallery-card.selected {
  border-color: #4b3832;
  box-shadow: 0 0 0 2px #4b3832;
}

.gallery-card-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.gallery-card-title {
  font-weight: 700;
  font-size: 1rem;
  color: #4b3832;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card-meta {
  font-size: 0.8rem;
  color: #aaa;
  margin: 0;
}

.card-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  flex: none;
  width: auto;
  transition: color 0.2s ease;
}

.card-delete-btn:hover {
  color: #ea4335;
}


.lists-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

.list-detail-panel {
  background: #fff;
  border: 1px solid #ede8e4;
  border-radius: 12px;
  padding: 28px;
  min-height: 400px;
}

.list-detail-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #4b3832;
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f0f0;
}

.list-items-ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 8px;
  transition: background 0.15s ease;
  background: transparent;
  border: none;
  margin-bottom: 4px;
}

.list-item-row:hover {
  background: #fafafa;
}

.list-item-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  accent-color: #4b3832;
}

.list-item-text {
  flex: 1;
  font-size: 0.95rem;
  color: #444;
  transition: all 0.2s ease;
}

.list-item-text.done {
  text-decoration: line-through;
  color: #bbb;
}

.btn-delete-item {
  background: transparent;
  border: none;
  color: #ddd;
  cursor: pointer;
  flex: none;
  width: auto;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.btn-delete-item:hover {
  color: #ea4335;
}

.add-item-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.add-item-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  width: auto;
  margin: 0;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #bbb;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
}

.empty-state-text {
  font-size: 1rem;
}

.empty-list-li {
  color: #bbb;
  text-align: center;
  font-size: 0.9rem;
  background: transparent !important;
  border: none !important;
  justify-content: center !important;
}


.pomodoro-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 50px 20px;
}

.pomo-mode-tabs {
  display: flex;
  background: #f1f3f4;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  justify-content: center;
}

.pomo-tab {
  background: transparent;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #888;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  flex: none;
  width: auto;
}

.pomo-tab.active {
  background: white;
  color: #4b3832;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.pomo-timer-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  margin-bottom: 36px;
}

.pomo-svg {
  transform: rotate(-90deg);
}

.pomo-track {
  fill: none;
  stroke: #f1f3f4;
  stroke-width: 10;
}

.pomo-progress {
  fill: none;
  stroke: #4b3832;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.pomo-time-display {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pomo-time {
  font-size: 3.2rem;
  font-weight: 700;
  color: #4b3832;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}

.pomo-label {
  font-size: 0.85rem;
  color: #aaa;
  margin-top: 4px;
}

.pomo-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 36px;
  flex-wrap: wrap;
  justify-content: center;
}

.pomo-btn-main {
  background: #4b3832;
  color: white;
  border: none;
  padding: 14px 40px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
  flex: none;
  width: auto;
  letter-spacing: 1px;
}

.pomo-btn-main:hover {
  background: #6b534b;
}

.pomo-btn-reset {
  background: transparent;
  border: 2px solid #e0e0e0;
  color: #888;
  padding: 14px 24px;
  border-radius: 50px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: none;
  width: auto;
}

.pomo-btn-reset:hover {
  border-color: #4b3832;
  color: #4b3832;
}

.pomo-sessions-row {
  display: flex;
  gap: 8px;
  margin-bottom: 40px;
}

.pomo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e0e0e0;
  transition: background 0.3s ease;
}

.pomo-dot.filled {
  background: #4b3832;
}

.pomo-settings {
  background: #fafafa;
  border: 1px solid #ede8e4;
  border-radius: 12px;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 20px;
  width: 100%;
  max-width: 460px;
}

.pomo-setting-label {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 6px;
  text-align: center;
  display: block;
}

.pomo-setting-input {
  width: 100%;
  text-align: center;
  padding: 8px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: #4b3832;
  box-sizing: border-box;
  margin: 0;
}


.notebook-editor-wrap {
  display: none;
  flex-direction: column;
  height: calc(100vh - 70px);
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.editor-toolbar {
  background: #fff;
  border-bottom: 1px solid #ede8e4;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.editor-back-btn {
  background: transparent;
  border: none;
  color: #4b3832;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 12px 6px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  flex: none;
  width: auto;
  margin-right: 12px;
  border-right: 1px solid #eee;
}

.editor-back-btn:hover {
  background: #f1f3f4;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: #e0e0e0;
  margin: 0 6px;
}

.toolbar-spacer {
  flex: 1;
  min-width: 20px;
}

hr.toolbar-divider {
  border: none;
}

.tb-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #555;
  padding: 5px 9px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  transition: all 0.15s ease;
  flex: none;
  width: auto;
}

.tb-btn:hover {
  background: #f1f3f4;
  border-color: #e0e0e0;
}

.tb-btn.active {
  background: #fff4e6;
  border-color: #be9b7b;
  color: #4b3832;
}

.tb-select {
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 0.85rem;
  color: #555;
  background: white;
  cursor: pointer;
  max-width: 80px;
}

.tb-color-label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #555;
}

.tb-color {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  padding: 2px;
}

.editor-title-bar {
  background: #fafafa;
  border-bottom: 1px solid #ede8e4;
  padding: 10px 40px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor-notebook-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #4b3832;
  border: none;
  background: transparent;
  outline: none;
  width: auto;
  flex: 1;
  padding: 4px 8px;
  border-radius: 4px;
  margin: 0;
  min-width: 100px;
}

.editor-notebook-title:focus {
  background: #fff;
  border: 1px solid #e0e0e0;
}

.editor-save-status {
  font-size: 0.8rem;
  color: #aaa;
  white-space: nowrap;
}

.editor-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: block;
  background: #f5f5f5;
  padding: 40px 20px;
}

.editor-page {
  width: 100%;
  max-width: 816px;
  min-height: 1056px;
  overflow-wrap: break-word;
  word-break: break-word;
  background: white;
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
  border-radius: 4px;
  padding: 72px 80px;
  outline: none;
  font-size: 1rem;
  line-height: 1.7;
  color: #333;
  box-sizing: border-box;
  margin: 0 auto 40px auto;
  display: block;
}

.editor-page:empty:before {
  content: 'Start writing here...';
  color: #ccc;
  pointer-events: none;
}

.editor-page.tpl-lined {
  background-image: repeating-linear-gradient(transparent, transparent 27px, #e8e8e8 27px, #e8e8e8 28px);
  background-size: 100% 28px;
  background-repeat: repeat;
  background-attachment: local;
}

.editor-page.tpl-grid {
  background-image: linear-gradient(#e8e8e8 1px, transparent 1px), linear-gradient(90deg, #e8e8e8 1px, transparent 1px);
  background-size: 28px 28px;
  background-repeat: repeat;
  background-attachment: local;
}

.editor-page.tpl-dot {
  background-image: radial-gradient(circle, #d0d0d0 1px, transparent 1px);
  background-size: 28px 28px;
  background-repeat: repeat;
  background-attachment: local;
}


.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

dialog.modal-overlay {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 100%;
  max-height: 100%;
}

dialog.modal-overlay[open] {
  display: flex;
}

.modal-box {
  background: white;
  border-radius: 16px;
  padding: 36px;
  width: 480px;
  max-width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  box-sizing: border-box;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #4b3832;
  margin: 0 0 24px;
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.template-section-label {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 12px;
  font-weight: 600;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 12px;
  margin-bottom: 24px;
  border: none;
  padding: 0;
}

.template-option {
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  flex: none;
  width: auto;
}

.template-option.selected,
.template-option:hover {
  border-color: #4b3832;
  background: #fff4e6;
}

.template-preview {
  width: 48px;
  height: 60px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 0 auto 8px;
  overflow: hidden;
  background: white;
  display: block;
}

.tpl-preview-lined {
  background-image: repeating-linear-gradient(transparent, transparent 8px, #ddd 8px, #ddd 9px);
}
.tpl-preview-grid {
  background-image: linear-gradient(#ddd 1px, transparent 1px), linear-gradient(90deg, #ddd 1px, transparent 1px);
  background-size: 9px 9px;
}

.tpl-preview-dot {
  background-image: radial-gradient(circle, #bbb 1px, transparent 1px);
  background-size: 9px 9px;
}
.template-name { font-size: 0.75rem; color: #555; font-weight: 600; }

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
  border: none;
}

.btn-modal-cancel {
  background: transparent;
  border: 1px solid #e0e0e0;
  color: #888;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  flex: none;
  width: auto;
}

.btn-modal-create {
  background: #4b3832;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  flex: none;
  width: auto;
}


@media (max-width: 850px) {
  .login-card {
    flex-direction: column;
    height: auto;
    max-width: 450px;
  }

  .auth-image {
    display: none;
  }

  .auth-form {
    flex: 1 1 100%;
    padding: 40px 30px;
  }

  .layout {
    flex-direction: column;
  }

  .sidebar-system {
    flex-direction: column;
    height: auto;
  }

  .icon-rail {
    width: 100%;
    flex-direction: row;
    height: 60px;
    padding: 0 15px;
    justify-content: center;
  }

  .rail-btn {
    flex-direction: row;
    gap: 8px;
    width: auto;
    height: 40px;
    padding: 5px 15px;
  }

  .rail-btn span {
    margin-top: 0;
  }

  .sidebar-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #eee;
  }

  .sidebar-panel.collapsed {
    width: 100%;
    height: 0;
    padding: 0 25px;
  }

  .nav-bar {
    flex-direction: column;
    height: auto;
    padding: 15px 0;
    gap: 15px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .lists-layout {
    grid-template-columns: 1fr;
  }

  .editor-page {
    padding: 40px 30px;
    min-height: calc(100vh - 200px);
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 500px) {
  .nav-links {
    gap: 10px;
  }

  .nav-links a {
    font-size: 0.85rem;
    padding: 5px 8px;
  }

  .page-container,
  .home-container,
  .pomodoro-page {
    padding: 20px 15px;
  }

  .editor-body {
    padding: 20px 10px;
  }

  .editor-title-bar {
    padding: 10px 20px;
  }

  .editor-page {
    padding: 30px 15px;
    border-radius: 0;
  }

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

  .pomo-settings {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
  }

  .modal-box {
    padding: 24px;
  }

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

  .editor-toolbar {
    padding: 10px;
  }

  .editor-back-btn {
    width: 100%;
    justify-content: center;
    margin-right: 0;
    border-right: none;
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
    padding-bottom: 10px;
  }
}