body {
    font-family: sans-serif;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 0;
}

.login-row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.navbar {
    background: #eee;
    padding: 10px;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    gap: 15px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-logo {
    height: 28px;
    width: auto;
}

.nav-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-tab {
    text-decoration: none;
    color: #444;
    font-weight: bold;
    padding: 1px 14px;
    border-radius: 4px;
    text-align: center;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.nav-tab:hover {
    background: #ddd;
    color: #111;
}

.nav-tab.active {
    background: #007bff;
    color: #fff;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
    min-width: 0;
}

@media (max-width: 600px) {
    .navbar {
        padding: 10px;
    }

    .nav-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .nav-left {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .nav-brand {
        justify-content: center;
    }

    .nav-tabs {
        width: 100%;
        justify-content: center;
    }

    .nav-tab {
        flex: 1;
        max-width: 150px;
        text-align: center;
    }

    .nav-links {
        justify-content: center;
        padding-left: 0;
        font-size: 0.9em;
    }
}

.nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.nav-links a {
    text-decoration: none;
    color: #007bff;
}

.card {
    border: 1px solid #ccc;
    padding: 15px;
    margin-bottom: 15px;
    background: #fff;
    border-radius: 4px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.card-header h3 {
    margin: 0;
}

.card-date {
    color: #666;
    font-size: 0.9em;
    font-weight: normal;
}

.files-panel {
    margin-top: 15px;
    background: #fdfdfd;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.files-panel h4 {
    margin: 0 0 10px 0;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    flex-wrap: wrap;
    gap: 10px;
}

.file-name {
    font-weight: 500;
    word-break: break-all;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.85em;
}

.flash {
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid;
}

.flash-error {
    border-color: red;
    color: red;
}

.flash-success {
    border-color: green;
    color: green;
}

.panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.btn-danger {
    display: inline-block;
    padding: 8px 12px;
    background: #dc3545;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background: #c82333;
}

.btn {
    display: inline-block;
    padding: 8px 12px;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.upload-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    overflow: hidden;
    margin-top: 15px;
    flex-wrap: wrap;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;

    & > input[type="file"] {
        flex-grow: 1;
    }

    & > button {
        padding: 8px 16px;
        background: #28a745;
        color: #fff;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }
}

@media (max-width: 432px) {
    .upload-form > button {
        width: 100%;
        margin-top: 10px;
    }
}

.initiative-form {
    margin-top: 15px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.ext-link::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 5px;
    vertical-align: middle;
    background: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%2216%22%20height=%2216%22%20viewBox=%220%200%2016%2016%22%20fill=%22none%22%20stroke=%22%23555%22%20stroke-width=%221.5%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Cpath%20d=%22M11%201h4v4%22/%3E%3Cpath%20d=%22M15%201L8.5%207.5%22/%3E%3Cpath%20d=%22M13%209v4a1%201%200%200%201-1%201H3a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1h4%22/%3E%3C/svg%3E') no-repeat center / contain;
}

.login-hint {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85em;
    color: #888;
}

.login-hint a {
    color: #888;
    text-decoration: underline;
}

.btn-pdf-view {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.85em;
    background: transparent;
    color: #555;
    border: 1px solid #bbb;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;

    &:hover {
        background: #f0f0f0;
        color: #333;
        border-color: #999;
    }

    &::before {
        content: "📄";
        font-size: 0.9em;
    }
}

/* PDF viewer modal preview */
.pdf-viewer-modal {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  background: rgba(0,0,0,0.6);

  & > .pdf-viewer-container {
    position: relative;
    width: 92%;
    max-width: 1200px;
    height: 90%;
    margin: 4% auto;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;

    & > .pdf-viewer-close {
      position: absolute;
      top: 8px;
      right: 12px;
      z-index: 10;
      background: rgba(255,255,255,0.95);
      border: 1px solid #ccc;
      font-size: 22px;
      line-height: 1;
      cursor: pointer;
      color: #333;
      border-radius: 4px;
      padding: 2px 10px;
      transition: background 0.1s;

      &:hover {
        background: #fff;
        border-color: #999;
      }
    }

    .pdf-viewer-wrapper {
      flex: 1;
      overflow: hidden;
      border-radius: 6px;

      & > .pdf-viewer-iframe {
        width: 100%;
        height: 100%;
        border: 0;
      }
    }
  }
}

.pdf-viewer-toggle:checked ~ .pdf-viewer-modal {
  display: block;
}

.description-text {
    white-space: pre-line;
}

.timeline-msg-lines { margin-top: 4px; }
.timeline-msg-line { padding: 2px 0; }

.smartid-section { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.smartid-or { margin: 0; color: #555; font-size: 0.9em; }
.smartid-btn { background: #0d7d3f; }
.smartid-btn:hover { background: #0a6532; }

.smartid-modal { display: none; position: fixed; inset: 0; z-index: 1000; }
.smartid-modal.is-open { display: block; }
.smartid-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.smartid-modal-content {
  position: relative; max-width: 460px; margin: 8vh auto; background: #fff;
  border-radius: 8px; padding: 28px 26px 22px; box-shadow: 0 12px 36px rgba(0,0,0,0.25);
}
.smartid-modal-content h3 { margin-top: 0; }
.smartid-close {
  position: absolute; top: 8px; right: 10px; background: transparent; border: 0;
  font-size: 26px; line-height: 1; cursor: pointer; color: #555;
}
.smartid-idcode {
  width: 100%; padding: 10px 12px; font-size: 1.1em; box-sizing: border-box;
  border: 1px solid #aaa; border-radius: 4px; letter-spacing: 2px;
}
.smartid-actions { margin-top: 12px; display: flex; gap: 8px; }
.smartid-error { color: #b00; margin-top: 10px; }
.smartid-vc-box {
  margin: 14px 0; text-align: center; padding: 16px; background: #f4f8fb;
  border: 1px solid #cdd; border-radius: 6px;
}
.smartid-vc { font-size: 2.4em; font-weight: bold; letter-spacing: 4px; color: #0d7d3f; }
.smartid-hint { color: #555; font-size: 0.9em; }
.smartid-spinner {
  margin: 14px auto 0; width: 28px; height: 28px;
  border: 3px solid #ddd; border-top-color: #0d7d3f; border-radius: 50%;
  animation: smartid-spin 0.8s linear infinite;
}
.smartid-result-message.success { color: #0d7d3f; font-weight: bold; }
.smartid-result-message.error { color: #b00; font-weight: bold; }
@keyframes smartid-spin { to { transform: rotate(360deg); } }
