*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { background: #000D08; }

body {
  font-family: 'Rubik', sans-serif;
  color: #fff;
  background: #000D08;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* view switching handled by JS via style.display */

/* ===== LOGIN ===== */
#login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
#login-view.active { display: flex; }

.login-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 48px 40px;
  width: 380px;
  text-align: center;
  backdrop-filter: blur(20px);
}

.login-logo { margin-bottom: 16px; }
.login-card h2 { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.login-sub { color: rgba(255,255,255,0.5); font-size: 14px; margin-bottom: 24px; }

.login-card input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}
.login-card input:focus { border-color: #03c8ba; }

.error-text { color: #ff6b6b; font-size: 13px; margin-top: 8px; min-height: 20px; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: #03c8ba;
  color: #000D08;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  width: 100%;
}
.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; border-radius: 8px; }

.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

.btn-danger {
  background: rgba(255,80,80,0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255,80,80,0.2);
  border-radius: 10px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:hover { background: rgba(255,80,80,0.25); }

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  background: rgba(0,13,8,0.9);
  backdrop-filter: blur(20px);
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title { font-size: 18px; font-weight: 600; }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-user {
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  margin-right: 8px;
}

/* ===== INBOX ===== */
.inbox-header {
  padding: 20px 24px 12px;
}
.inbox-header h3 { font-size: 20px; font-weight: 500; }

.badge {
  background: #03c8ba;
  color: #000D08;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

.inbox-list { padding: 0 24px; }

.mail-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.mail-row:hover { background: rgba(255,255,255,0.04); }

.mail-row.unread { font-weight: 500; }
.mail-row.unread .mail-subject { color: #fff; }
.mail-row.unread .mail-indicator { background: #03c8ba; }

.mail-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: transparent;
}

.mail-from {
  width: 180px;
  flex-shrink: 0;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-subject {
  flex: 1;
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-date {
  flex-shrink: 0;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  width: 90px;
  text-align: right;
}

.loading, .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255,255,255,0.35);
  font-size: 15px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px;
}

/* ===== MESSAGE ===== */
.message-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.message-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.message-header h2 { font-size: 22px; font-weight: 500; margin-bottom: 12px; }

.message-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.msg-from { font-size: 14px; color: #03c8ba; }
.msg-date { font-size: 13px; color: rgba(255,255,255,0.35); }
.msg-to { font-size: 13px; color: rgba(255,255,255,0.35); }

.message-body {
  padding: 0 24px 24px;
}

.message-body iframe {
  width: 100%;
  min-height: 400px;
  border: none;
  background: #fff;
  border-radius: 10px;
  margin-top: 16px;
}

.attachments {
  padding: 0 24px 24px;
}
.attachments h4 {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}
.attachment-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-right: 8px;
  margin-bottom: 6px;
}

/* ===== COMPOSE ===== */
.compose-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.compose-toolbar h3 { font-size: 16px; font-weight: 500; }

.compose-form { padding: 24px; }

.form-row {
  margin-bottom: 16px;
}
.form-row label {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 6px;
}
.form-row input,
.form-row textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.form-row input:focus,
.form-row textarea:focus { border-color: #03c8ba; }

.form-row-body { flex: 1; }
.form-row textarea {
  min-height: 300px;
  resize: vertical;
  line-height: 1.6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header { flex-direction: column; gap: 10px; }
  .header-right { flex-wrap: wrap; justify-content: center; }
  .mail-from { width: 100px; }
  .mail-date { width: 60px; font-size: 11px; }
  .login-card { width: 90vw; padding: 32px 24px; }
}
