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

  --sage-dark:    #1A2F6E;  --sage:         #3A52A8;  --sage-light:   #C9A864;  --sage-pale:    #F0E5C2;  --cream:        #E8EEF8;  --cream-dark:   #DBE0EC;  --muted:        #7A8499;  --danger:       #c0392b;
  --danger-bg:    #fbe9e7;
  --bg-light:     #FFFFFF;}
html, body {
  -webkit-text-size-adjust: none;
  -moz-text-size-adjust: none;
  text-size-adjust: none;
}
body {
  font-family: 'Poppins', sans-serif;
  color: var(--sage-dark);
  background: var(--bg-light);
}

.guest-page {
  background: linear-gradient(135deg, #FFFFFF 0%, #E8EEF8 100%);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
@media (max-width: 600px) {
  .guest-page { padding: 20px 16px; }
  .guest-card { padding: 32px 24px; }
  .login-page { padding: 20px 16px; }
  .login-box { padding: 32px 24px; }
  .sharemoments-footer { padding: 18px 16px; font-size: 12px; }
}
.guest-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  max-width: 520px;
  width: 100%;
  padding: 40px 32px;
  text-align: center;
  position: relative;
}
.guest-card::before,
.guest-card::after,
.login-box::before,
.login-box::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: 46px 46px;
}
.guest-card::before,
.login-box::before {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath d='M 4,3 L 10,3 L 8.5,7 Q 7,7.5 5.5,7 Z' fill='none' stroke='%23C9A864' stroke-width='0.9' stroke-linejoin='round'/%3E%3Cline x1='7' y1='7.5' x2='7' y2='12' stroke='%23C9A864' stroke-width='0.9' stroke-linecap='round'/%3E%3Cline x1='5' y1='12.5' x2='9' y2='12.5' stroke='%23C9A864' stroke-width='1.1' stroke-linecap='round'/%3E%3Ccircle cx='6.5' cy='4' r='0.3' fill='%23C9A864'/%3E%3Ccircle cx='8' cy='5.5' r='0.3' fill='%23C9A864'/%3E%3Ccircle cx='7' cy='6.5' r='0.25' fill='%23C9A864'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cg transform='translate(28 0) scale(-1 1)'%3E%3Cpath d='M 4,3 L 10,3 L 8.5,7 Q 7,7.5 5.5,7 Z' fill='none' stroke='%23C9A864' stroke-width='0.9' stroke-linejoin='round'/%3E%3Cline x1='7' y1='7.5' x2='7' y2='12' stroke='%23C9A864' stroke-width='0.9' stroke-linecap='round'/%3E%3Cline x1='5' y1='12.5' x2='9' y2='12.5' stroke='%23C9A864' stroke-width='1.1' stroke-linecap='round'/%3E%3Ccircle cx='6.5' cy='4' r='0.3' fill='%23C9A864'/%3E%3Ccircle cx='8' cy='5.5' r='0.3' fill='%23C9A864'/%3E%3Ccircle cx='7' cy='6.5' r='0.25' fill='%23C9A864'/%3E%3C/g%3E%3C/svg%3E");
  background-position: top left, top right;
}
.guest-card::after,
.login-box::after {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath d='M 4,15 L 10,15 L 8.5,19 Q 7,19.5 5.5,19 Z' fill='none' stroke='%23C9A864' stroke-width='0.9' stroke-linejoin='round'/%3E%3Cline x1='7' y1='19.5' x2='7' y2='24' stroke='%23C9A864' stroke-width='0.9' stroke-linecap='round'/%3E%3Cline x1='5' y1='24.5' x2='9' y2='24.5' stroke='%23C9A864' stroke-width='1.1' stroke-linecap='round'/%3E%3Ccircle cx='6.5' cy='16' r='0.3' fill='%23C9A864'/%3E%3Ccircle cx='8' cy='17.5' r='0.3' fill='%23C9A864'/%3E%3Ccircle cx='7' cy='18.5' r='0.25' fill='%23C9A864'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cg transform='translate(28 0) scale(-1 1)'%3E%3Cpath d='M 4,15 L 10,15 L 8.5,19 Q 7,19.5 5.5,19 Z' fill='none' stroke='%23C9A864' stroke-width='0.9' stroke-linejoin='round'/%3E%3Cline x1='7' y1='19.5' x2='7' y2='24' stroke='%23C9A864' stroke-width='0.9' stroke-linecap='round'/%3E%3Cline x1='5' y1='24.5' x2='9' y2='24.5' stroke='%23C9A864' stroke-width='1.1' stroke-linecap='round'/%3E%3Ccircle cx='6.5' cy='16' r='0.3' fill='%23C9A864'/%3E%3Ccircle cx='8' cy='17.5' r='0.3' fill='%23C9A864'/%3E%3Ccircle cx='7' cy='18.5' r='0.25' fill='%23C9A864'/%3E%3C/g%3E%3C/svg%3E");
  background-position: bottom left, bottom right;
}
.initials-top {
  font-family: 'Great Vibes', cursive;
  font-size: 72px;
  font-weight: 400;
  color: var(--sage-dark);
  line-height: 1;
  margin-bottom: 8px;
}
.event-date {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  letter-spacing: 4px;
  color: #9F8344;
  font-weight: 600;
  margin-bottom: 24px;
}
.divider {
  width: 160px;
  height: 20px;
  background: transparent;
  background-image: linear-gradient(to right, transparent 0%, #C9A864 20%, #C9A864 80%, transparent 100%);
  background-size: 100% 1.2px;
  background-repeat: no-repeat;
  background-position: center;
  margin: 0 auto 24px;
  position: relative;
}
.divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  background: #C9A864;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid white;
  box-shadow: 0 0 0 1px #C9A864;
}
.guest-card h1 {
  font-family: 'Great Vibes', cursive;
  color: var(--sage-dark);
  font-size: 38px;
  margin-bottom: 12px;
  font-weight: 700;
  line-height: 1.1;
}
.subtitle {
  color: var(--sage);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.6;
  font-weight: 400;
}
.form-group { margin-bottom: 18px; text-align: left; }
.form-group label {
  display: block;
  color: var(--sage-dark);
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 600;
}
.label-badge {
  display: inline-block;
  background: #1A2F6E;
  color: #F0E5C2;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  letter-spacing: 1px;
  vertical-align: middle;
  margin-right: 4px;
  position: relative;
  top: -1px;
}
.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--cream-dark);
  border-radius: 12px;
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  background: white;
  transition: all 0.2s;
  color: var(--sage-dark);
}
.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
  outline: none;
  border-color: var(--sage-light);
  box-shadow: 0 0 0 3px rgba(201,168,100,0.22);
}
.form-group input.error {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.form-group input::placeholder {
  color: var(--muted);
  font-weight: 400;
}
.file-upload-wrapper {
  position: relative;
  border: 2px dashed var(--sage-light);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  background: var(--cream);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--sage-dark);
}
.file-upload-wrapper:hover {
  background: #F0E5C2;
  border-color: #9F8344;
}
.file-upload-wrapper.error {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.file-upload-wrapper input[type="file"] {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.upload-icon { margin-bottom: 10px; color: var(--sage-light); }
.upload-text {
  color: var(--sage-dark);
  font-size: 14px;
  font-weight: 600;
}
.upload-hint {
  color: var(--sage);
  font-size: 12px;
  margin-top: 5px;
  font-weight: 400;
}
.file-count {
  margin-top: 10px;
  color: var(--sage-dark);
  font-weight: 600;
  font-size: 13px;
}
.field-error {
  display: none;
  color: var(--danger);
  font-size: 12px;
  margin-top: 8px;
  padding-left: 4px;
  font-weight: 500;
}
.field-error.show { display: block; }

.clear-files-btn {
  display: none;
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  background: transparent;
  border: 2px solid var(--sage-light);
  color: var(--sage);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.clear-files-btn.show { display: block; }
.clear-files-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-bg);
}
.clear-files-btn::before {
  content: '\2715  ';
  font-weight: 400;
}

.guest-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #1A2F6E 0%, #3A52A8 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.2s;
}
.guest-btn:not(.guest-btn-outline) {
  position: relative;
  z-index: 0;
  overflow: hidden;
}
.guest-btn:not(.guest-btn-outline)::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, #0F1F4F 0%, #2A4288 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.guest-btn:hover:not(:disabled)::before {
  opacity: 1;
}
.guest-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.guest-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}
a.guest-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}
.guest-btn-outline {
  margin-top: 12px;
  background: #F5EDD6;
  background: linear-gradient(135deg, #F5EDD6 0%, #D9BC7E 100%);
  color: var(--sage-dark);
  border: none;
  box-shadow: none;
  transition: filter 0.25s ease;
}
.guest-btn.guest-btn-outline:hover {
  background: #F5EDD6;
  background: linear-gradient(135deg, #F5EDD6 0%, #D9BC7E 100%);
  filter: saturate(1.25) brightness(0.96);
  transform: none;
  box-shadow: none;
}

.upload-unavailable-message {
  margin-top: 12px;
  background: var(--cream);
  color: var(--sage-dark);
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.upload-storage-full {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--danger-bg);
  border-radius: 10px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.progress-container { display: none; margin-top: 18px; }
.progress-container.show { display: block; }
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--cream-dark);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1A2F6E 0%, #3A52A8 100%);
  width: 0%;
  transition: width 0.3s;
  border-radius: 100px;
}
.progress-text {
  margin-top: 10px;
  color: var(--sage-dark);
  font-size: 13px;
  font-weight: 500;
}

.message {
  margin-top: 12px;
}

.success {
  background: #DCF5D7;
  color: #1F8A3D;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
.success .success-greeting {
  font-weight: 500;
}
.success .success-line {
  margin-top: 4px;
}
.success .success-line:last-child {
  margin-bottom: 0;
}
.success strong {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--sage-dark);
}
.success strong.name-highlight {
  font-family: 'Great Vibes', cursive;
  font-weight: 700;
  font-size: 22px;
  color: var(--sage-dark);
  line-height: 1;
}

.error-msg {
  background: var(--danger-bg);
  color: var(--danger);
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.footer-guest {
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.footer-guest .cursive-full {
  font-family: 'Great Vibes', cursive;
  font-size: 24px;
  color: #9F8344;
  font-weight: 400;
}

.sharemoments-footer {
  background: linear-gradient(135deg, #1A2F6E 0%, #3A52A8 100%);
  color: white;
  padding: 22px 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
}
.sharemoments-footer a {
  color: white;
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1.5px solid rgba(255,255,255,0.5);
  padding-bottom: 1px;
  transition: border-color 0.15s;
}
.sharemoments-footer a:hover { border-bottom-color: white; }

.sharemoments-footer .br-mobile { display: none; }
@media (max-width: 600px) {
  .sharemoments-footer .br-mobile { display: inline; }
}

.login-page {
  background: linear-gradient(135deg, #FFFFFF 0%, #E8EEF8 100%);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.login-box {
  background: white;
  padding: 40px 36px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  text-align: center;
  max-width: 420px;
  width: 100%;
  position: relative;
}
.login-box h1 {
  font-family: 'Great Vibes', cursive;
  color: var(--sage-dark);
  margin-bottom: 12px;
  font-size: 36px;
  font-weight: 700;
}
.login-sub {
  color: var(--sage);
  font-size: 13px;
  margin-bottom: 24px;
  font-weight: 400;
}
.login-box input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--cream-dark);
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 16px;
  font-family: 'Poppins', sans-serif;
  color: var(--sage-dark);
}
.login-box input[type="password"]:focus {
  outline: none;
  border-color: var(--sage-light);
  box-shadow: 0 0 0 3px rgba(201,168,100,0.22);
}
.login-box button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #1A2F6E 0%, #3A52A8 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(26, 47, 110, 0.3);
}
.login-box button:hover {
  background: linear-gradient(135deg, #0F1F4F 0%, #2A4288 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(26, 47, 110, 0.42);
}
.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: -6px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.admin-page {
  background: linear-gradient(135deg, #FFFFFF 0%, #E8EEF8 100%);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.admin-container {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 40px auto;
  padding: 0 20px;
}
.admin-header {
  background: linear-gradient(135deg, #1A2F6E 0%, #3A52A8 100%);
  color: white;
  padding: 24px 20px;
}
.admin-header-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}
.admin-title {
  font-family: 'Great Vibes', cursive;
  font-size: 32px;
  font-weight: 700;
  color: white;
}
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  padding: 11px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Poppins', sans-serif;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.btn-primary { background: white; color: var(--sage-dark); }
.btn-primary:hover { background: #F0F4FA; }
.btn-logout {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-logout:hover { background: rgba(255,255,255,0.28); }

.admin-footer {
  background: linear-gradient(135deg, #1A2F6E 0%, #3A52A8 100%);
  color: white;
  padding: 24px 20px;
}
.admin-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.storage-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.storage-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.storage-title h3 {
  font-family: 'Great Vibes', cursive;
  font-size: 26px;
  color: white;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}
.storage-numbers {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
}
.storage-numbers strong {
  color: white;
  font-size: 15px;
  font-weight: 700;
}
.storage-progress {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  overflow: hidden;
}
.storage-fill {
  height: 100%;
  background: white;
  border-radius: 100px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
  transition: width 0.5s;
}
.storage-fill.warning { background: #ffd089; box-shadow: 0 0 8px rgba(255, 208, 137, 0.5); }
.storage-fill.danger  { background: #ff8a72; box-shadow: 0 0 8px rgba(255, 138, 114, 0.5); }
.storage-footer-row {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  flex-wrap: wrap;
  gap: 8px;
}
.storage-available { color: white; font-weight: 600; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  background: white;
  padding: 22px;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  text-align: center;
}
.stat-value {
  font-family: 'Great Vibes', cursive;
  font-size: 42px;
  color: var(--sage-dark);
  font-weight: 700;
  line-height: 1;
}
.stat-label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}
.section-title {
  font-family: 'Great Vibes', cursive;
  font-size: 30px;
  color: var(--sage-dark);
  margin-bottom: 18px;
  font-weight: 700;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.section-title-row .section-title { margin-bottom: 0; }
a.view-mode-btn { text-decoration: none; }
@media (max-width: 700px) {
  .section-title-row { flex-direction: column; align-items: center; }
  .section-title-row .section-title { text-align: center; }
}

.folder-card {
  background: white;
  border-radius: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  transition: all 0.2s;
}
.folder-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.folder-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.folder-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #1A2F6E 0%, #3A52A8 100%);
}
.folder-details h3 {
  color: var(--sage-dark);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}
.folder-badge {
  background: var(--sage-pale);
  color: var(--sage-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  margin-left: 4px;
  letter-spacing: 0.5px;
  vertical-align: middle;
}
.folder-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}
.folder-time svg {
  color: var(--muted);
  flex-shrink: 0;
}
.folder-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.folder-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-sm { padding: 9px 16px; font-size: 12px; }
.btn-download { background: var(--sage-dark); color: white; }
.btn-download:hover { background: #2A4280; }
.btn-view {
  background: var(--cream-dark);
  color: var(--sage-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-view:hover { background: #CCD3E3; }

.btn-message {
  background: var(--sage-light);
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
}
.btn-message:hover { background: #D6B97A; color: white; }
.btn-message svg {
  color: white;
}

@media (max-width: 600px) {
  .folder-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px 18px;
  }
  .folder-info { width: 100%; }
  .folder-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.textarea-wrapper {
  position: relative;
}
.message-textarea {
  width: 100%;
  min-height: 110px;
  padding: 14px 16px;
  border: 2px solid var(--cream-dark);
  border-radius: 12px;
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  background: white;
  transition: all 0.2s;
  color: var(--sage-dark);
  resize: vertical;
  line-height: 1.5;
  display: block;
}
.message-textarea:focus {
  outline: none;
  border-color: var(--sage-light);
  box-shadow: 0 0 0 3px rgba(201,168,100,0.22);
}
.message-textarea::placeholder {
  color: var(--muted);
  font-weight: 400;
}
.char-counter {
  display: none;
  position: absolute;
  bottom: 10px;
  right: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-light);
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: 0.3px;
  pointer-events: none;
  user-select: none;
  transition: background 0.2s, color 0.2s;
}
.char-counter.show {
  display: block;
}
.char-counter.warning {
  background: #fff0d9;
  color: #c77d1a;
}
.char-counter.danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.message-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.message-modal.open {
  display: flex;
}
.message-modal-backdrop {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(26, 26, 26, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.message-modal-content {
  position: relative;
  background: white;
  border-radius: 20px;
  padding: 28px 28px 24px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.message-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--sage-dark);
  border: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  z-index: 1;
  font-family: Arial, sans-serif;
}
.message-modal-close:hover {
  background: var(--cream-dark);
}
.message-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 40px;
}
.message-modal-meta {
  flex: 1;
  min-width: 0;
}
.message-modal-name {
  font-family: 'Great Vibes', cursive;
  font-size: 28px;
  font-weight: 700;
  color: var(--sage-dark);
  line-height: 1.1;
}
.message-modal-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}
.message-modal-divider {
  height: 1.5px;
  background: var(--cream-dark);
  margin: 20px 0;
  border-radius: 2px;
}
.message-modal-body {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--sage-dark);
  white-space: pre-wrap;
  word-wrap: break-word;
  padding: 0 4px;
}
.message-modal-footer {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}
.message-modal-footer .btn {
  padding: 11px 28px;
}

@media (max-width: 600px) {
  .message-modal { padding: 16px; }
  .message-modal-content { padding: 24px 20px 20px; border-radius: 16px; }
  .message-modal-name { font-size: 24px; }
  .message-modal-body { font-size: 14px; }
}
.empty-state {
  background: white;
  padding: 60px 20px;
  text-align: center;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.empty-state h3 {
  font-family: 'Great Vibes', cursive;
  font-size: 28px;
  color: var(--sage-dark);
  font-weight: 700;
  margin-bottom: 10px;
}
.empty-state p { color: var(--muted); font-size: 14px; }
.gallery-grid .empty-state { grid-column: 1 / -1; }

.gallery-top {
  background: linear-gradient(135deg, #1A2F6E 0%, #3A52A8 100%);
  padding: 24px 20px;
  border-bottom: none;
}

.gallery-top-content {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
}
.gallery-title-wrap {
  text-align: center;
  min-width: 0;
}
.gallery-title {
  font-family: 'Great Vibes', cursive;
  font-size: 36px;
  color: white;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
}
.gallery-title .folder-badge {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  vertical-align: middle;
  margin-left: 6px;
}
.gallery-sub {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  display: block;
  margin-top: 2px;
}
.view-modes-row {
  max-width: 1100px;
  margin: 16px auto 0;
  display: flex;
  justify-content: center;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: none;
  color: var(--sage-dark);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.back-btn:hover { background: #F0F4FA; }
.gallery-top-content .btn-download {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .gallery-top { padding: 14px 16px; }
  .gallery-top-content {
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    gap: 12px;
    justify-content: space-between;
  }
  .gallery-title-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    order: 2;
  }
  .gallery-title { font-size: 30px; }
  .gallery-sub { font-size: 11px; }
  .back-btn { padding: 8px 14px; font-size: 12px; justify-self: start; }
  .gallery-top-content .btn-download { padding: 8px 14px; font-size: 12px; justify-self: end; }
  .view-modes-row { margin-top: 12px; }
}
.view-modes {
  display: flex;
  gap: 4px;
  background: var(--cream);
  padding: 4px;
  border-radius: 100px;
}
.view-mode-btn {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-family: 'Poppins', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
}
.view-mode-btn.active {
  background: var(--sage-dark);
  color: white;
}
.view-mode-btn svg { width: 14px; height: 14px; }

.gallery-container {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 40px auto;
  padding: 0 20px;
}

.gallery-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.gallery-grid .gallery-item {
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: var(--cream-dark);
  aspect-ratio: 1;
  min-width: 0;
}
.gallery-grid .gallery-item:hover {
  border-color: var(--sage-light);
  transform: translateY(-2px);
}
.gallery-grid .thumb {
  width: 100%;
  height: 100%;
  position: relative;
  object-fit: cover;
  display: block;
}

.gallery-mosaic {
  width: 100%;
  display: none;
  column-count: 3;
  column-gap: 10px;
}
.gallery-mosaic.active { display: block; }
.gallery-grid.hidden { display: none; }

.gallery-mosaic .gallery-item {
  break-inside: avoid;
  margin-bottom: 10px;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  transition: all 0.2s;
  display: block;
  background: var(--cream-dark);
}
.gallery-mosaic .gallery-item:hover { border-color: var(--sage-light); }
.gallery-mosaic .thumb {
  width: 100%;
  display: block;
  height: auto;
}

@media (max-width: 700px) {
  .gallery-mosaic { column-count: 2; }
}

.video-thumb {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  background: #2a2a2a;
  color: white;
  overflow: hidden;
}
.video-thumb video,
.video-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.video-thumb svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  opacity: 0.9;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.6));
}
.video-thumb svg[fill="currentColor"] {
  box-sizing: content-box;
  width: 26px;
  height: 26px;
  padding: 11px 12px 11px 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  opacity: 1;
  filter: none;
  transition: color 0.15s, background 0.15s;
}
.gallery-item:hover .video-thumb svg[fill="currentColor"] {
  color: #d9d9d9;
  background: rgba(0, 0, 0, 0.55);
}
.video-label {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  background: var(--sage-light);
  color: #fff;
  padding: 3px 8px;
  border-radius: 100px;
  font-weight: 700;
  letter-spacing: 1px;
  z-index: 1;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 28px auto 0;
  flex-wrap: wrap;
  padding: 0 20px;
  font-family: 'Poppins', sans-serif;
}
.pagination .page-btn {
  background: white;
  color: var(--sage-dark);
  padding: 9px 14px;
  min-width: 40px;
  text-align: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--cream-dark);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pagination a.page-btn:hover {
  background: var(--cream);
  border-color: var(--sage-light);
}
.pagination .page-btn.active {
  background: var(--sage-dark);
  color: white;
  border-color: var(--sage-dark);
  cursor: default;
}
.pagination .page-nav {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.pagination .page-dots {
  color: var(--muted);
  padding: 0 4px;
  font-weight: 700;
  font-size: 14px;
}
@media (max-width: 600px) {
  .pagination { gap: 4px; margin-top: 30px; }
  .pagination .page-btn { padding: 7px 11px; min-width: 36px; font-size: 12px; }
}

.lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.95);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-content {
  max-width: 90%;

  max-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  border-radius: 12px;
  display: block;
}
.lightbox-note {
  color: #fff;
  text-align: center;
  font-size: 15px;
  line-height: 1.7;
  padding: 40px 30px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  max-width: 420px;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10001;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  color: white;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10001;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 13px;
  background: rgba(255,255,255,0.15);
  padding: 8px 16px;
  border-radius: 100px;
  font-weight: 500;
}
@media (max-width: 380px) {
  .input-row { grid-template-columns: 1fr; }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.guest-page,
.login-page,
.admin-page {
  flex: 1 0 auto;
  min-height: auto;
}
