/* v2 Styles - Social Media Portal */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    line-height: 1.6;
    color: #2d3436;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.portal-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    position: sticky;
    top: 0;
    z-index: 999;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .portal-header {
    background: rgba(16, 20, 25, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo img {
    max-height: 50px;
    transition: transform 0.3s ease;
}

.header-logo:hover img {
    transform: scale(1.05);
}

/* Controls */
.portal-controls {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .portal-controls {
    background: rgba(16, 20, 25, 0.7);
}

.controls-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}

.form-select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #2d3436;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .form-select {
    background: rgba(16, 20, 25, 0.9);
    color: #dfe6e9;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--accent);
    color: white;
    box-shadow: none;
}

.btn:hover {
    background: var(--accent-strong);
    transform: none;
    box-shadow: none;
}

.header-button {
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.header-button[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
}

.btn:active {
    transform: none;
}

.btn::before { display: none; }

.btn-secondary {
    background: transparent;
    box-shadow: none;
}

.btn-secondary:hover {
    box-shadow: none;
}

.btn-danger {
    background: transparent;
    box-shadow: none;
}

.btn-danger:hover {
    box-shadow: none;
}

/* Page Header */
.page-header {
    text-align: center;
    padding: 28px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.35) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 60s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0 0 6px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.page-header p {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.85;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Notification */
.notification {
    padding: 18px 25px;
    margin: 20px;
    border-radius: 16px;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Post Grid */
.post-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

/* Post Card */
.post-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    backdrop-filter: blur(20px);
    border: none;
}

[data-theme="dark"] .post-card {
    background: rgba(16, 20, 25, 0.9);
    border: none;
}

.post-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.post-card.story {
    border: none;
}

.post-card.ingepland {
    border: none;
}

/* Post Header */
.post-header {
    padding: 25px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .post-header {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
}

.post-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.post-id {
    color: #e91e63;
    font-weight: 700;
    font-size: 14px;
}

.post-client {
    color: #2d3436;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    transition: color 0.3s ease;
}

[data-theme="dark"] .post-client {
    color: #dfe6e9;
}

.post-client:hover {
    color: #667eea;
}

.post-date {
    color: #636e72;
    font-size: 14px;
    font-weight: 600;
}

[data-theme="dark"] .post-date {
    color: #b2bec3;
}

/* Post Media */
.post-media {
    position: relative;
    aspect-ratio: 1/1;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

[data-theme="dark"] .post-media {
    background: rgba(0, 0, 0, 0.2);
}

.post-media img, .post-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-media img,
.post-card:hover .post-media video {
    transform: scale(1.05);
}

/* Slideshow */
.slideshow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.slideshow-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.15);
}

.prev-btn { left: 12px; }
.next-btn { right: 12px; }

/* Post Content */
.post-content {
    padding: 25px;
    color: #2d3436;
    line-height: 1.8;
    max-height: 250px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .post-content {
    color: #dfe6e9;
    background: rgba(0, 0, 0, 0.1);
}

.post-content::-webkit-scrollbar {
    width: 6px;
}

.post-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.post-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.post-content p {
    margin-bottom: 10px;
}

.post-content p:last-child {
    margin-bottom: 0;
}

.post-content p:first-child {
    margin-top: 0;
}

/* Post Hashtags */
.post-hashtags {
    padding: 0 25px 20px;
    color: #3498db;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .post-hashtags {
    background: rgba(0, 0, 0, 0.2);
}

/* Post Platforms */
.post-platforms {
    display: flex;
    gap: 12px;
    padding: 0 25px 20px;
    align-items: center;
    flex-wrap: wrap;
}

.post-platforms img {
    width: 32px;
    height: 32px;
    filter: grayscale(0.3);
    transition: all 0.3s ease;
}

.post-platforms img:hover {
    transform: scale(1.2);
    filter: grayscale(0);
}

/* Post Actions */
.post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 25px 25px;
}

.post-action-form {
    display: inline-flex;
    margin: 0;
}

.post-actions .btn {
    padding: 10px 18px;
    font-size: 13px;
}

/* Week Header (styling lives in index.php) */
.week-header {
    grid-column: auto;
}

[data-theme="dark"] .week-header {
    background: transparent;
}

.week-header::before {
    content: none;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 40px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .empty-state {
    background: rgba(16, 20, 25, 0.9);
}

.empty-state::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0,0,0,0.05) 0%, transparent 70%);
}

.empty-state h2 {
    color: #2d3436;
    margin-bottom: 20px;
    font-size: 32px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .empty-state h2 {
    color: #dfe6e9;
}

.empty-state p {
    color: #636e72;
    font-size: 16px;
    position: relative;
    z-index: 1;
}

.empty-state a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.empty-state a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.is-open {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.lightbox-overlay img {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.lightbox-overlay.is-open img {
    animation: zoomIn 0.4s ease;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 35px;
    font-size: 50px;
    line-height: 1;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    color: #e91e63;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    border: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
}

.theme-toggle:hover {
    transform: scale(1.15) rotate(15deg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle span {
    font-size: 30px;
    transition: transform 0.4s ease;
}

[data-theme="dark"] .theme-toggle span {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-15px) scale(1.2); }
    60% { transform: translateY(-7px) scale(1.1); }
}

/* Responsive */
@media (max-width: 768px) {
    .controls-content {
        flex-direction: column;
        gap: 15px;
    }

    .control-buttons {
        width: 100%;
        flex-direction: column;
    }

    .page-header h1 {
        font-size: 22px;
    }

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

    .post-card {
        transform: none !important;
    }

    .post-card:hover {
        transform: none !important;
    }
}

/* Shared portal modal */
[data-modal] { display: none !important; }

.portal-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(12, 10, 14, 0.68);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.portal-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.portal-modal {
    width: min(430px, 100%);
    padding: 30px;
    border: 1px solid var(--line, rgba(23, 20, 26, 0.08));
    border-radius: 24px;
    background: var(--surface, #fff);
    color: var(--ink, #17141a);
    box-shadow: 0 32px 90px -30px rgba(0, 0, 0, 0.72);
    text-align: center;
    transform: translateY(14px) scale(0.97);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-modal-overlay.is-visible .portal-modal { transform: translateY(0) scale(1); }

.portal-modal-icon {
    display: grid;
    width: 62px;
    height: 62px;
    margin: 0 auto 19px;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.portal-modal-icon::before { display: block; }
.portal-modal--success .portal-modal-icon { color: #2e9e54; background: rgba(46, 158, 84, 0.1); }
.portal-modal--success .portal-modal-icon::before { content: '\2713'; }
.portal-modal--error .portal-modal-icon { color: #c44150; background: rgba(196, 65, 80, 0.1); }
.portal-modal--error .portal-modal-icon::before { content: '\00d7'; font-size: 42px; font-weight: 400; }
.portal-modal--warning .portal-modal-icon { color: #b77a1d; background: rgba(183, 122, 29, 0.1); }
.portal-modal--warning .portal-modal-icon::before { content: '!'; }
.portal-modal--question .portal-modal-icon { color: var(--accent, #ee2a7b); background: var(--accent-soft, rgba(238, 42, 123, 0.14)); }
.portal-modal--question .portal-modal-icon::before { content: '?'; }
.portal-modal--info .portal-modal-icon { color: var(--accent, #ee2a7b); background: var(--accent-soft, rgba(238, 42, 123, 0.14)); }
.portal-modal--info .portal-modal-icon::before { content: 'i'; font-family: Georgia, serif; }

.portal-modal-copy h2 {
    margin: 0;
    font-family: 'Oswald', 'Plus Jakarta Sans', sans-serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.25;
}

.portal-modal-copy p {
    margin: 10px 0 0;
    color: var(--ink-soft, #6f6772);
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.portal-modal-choice { margin-top: 20px; }

.portal-modal-choice select {
    width: 100%;
    padding: 12px 42px 12px 14px;
    border: 1px solid var(--line, rgba(23, 20, 26, 0.12));
    border-radius: 12px;
    outline: none;
    background: var(--surface-2, #fbf6f9);
    color: var(--ink, #17141a);
    font: inherit;
    font-size: 13px;
}

.portal-modal-choice select:focus {
    border-color: var(--accent, #ee2a7b);
    box-shadow: 0 0 0 3px var(--accent-soft, rgba(238, 42, 123, 0.14));
}

.portal-modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 26px;
}

.portal-modal-button {
    min-width: 112px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.portal-modal-button:hover { transform: translateY(-1px); }
.portal-modal-button:focus-visible { outline: 3px solid var(--accent-soft, rgba(238, 42, 123, 0.2)); outline-offset: 2px; }
.portal-modal-button.is-primary { background: var(--accent, #ee2a7b); color: #fff; }
.portal-modal-button.is-primary:hover { background: var(--accent-strong, #c00f5d); }
.portal-modal-button.is-secondary { border-color: var(--line, rgba(23, 20, 26, 0.12)); background: var(--surface-2, #fbf6f9); color: var(--ink, #17141a); }
.portal-modal-button.is-secondary:hover { border-color: var(--accent, #ee2a7b); color: var(--accent-strong, #c00f5d); }
.portal-modal-button.is-danger { background: #b83d4b; color: #fff; }
.portal-modal-button.is-danger:hover { background: #922f3a; }

@media (max-width: 520px) {
    .portal-modal { padding: 26px 20px 22px; border-radius: 20px; }
    .portal-modal-actions { flex-direction: column-reverse; }
    .portal-modal-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-modal-overlay,
    .portal-modal { transition: none; }
}

/* Login Page */
.login-wrapper {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 24px;
}

.form-container {
    width: 100%;
    max-width: 420px;
    padding: 44px 40px;
    border-radius: 20px;
    background: var(--surface, #ffffff);
    border: 1px solid var(--line, rgba(23, 20, 26, 0.08));
    box-shadow: var(--shadow-md, 0 24px 60px -24px rgba(38, 35, 45, 0.4));
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-container .logo {
    text-align: center;
    margin-bottom: 28px;
}

.form-container h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 30px;
    font-weight: 600;
    color: var(--ink, #17141a);
    text-align: center;
    margin-bottom: 6px;
}

.form-container .wrapper > p {
    text-align: center;
    color: var(--ink-soft, #6f6772);
    margin-bottom: 26px;
    font-size: 14px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft, #6f6772);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    border: 1px solid var(--line, rgba(38, 35, 45, 0.12));
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    padding: 13px 16px;
    color: var(--ink, #17141a);
    background: var(--surface-2, #fbf6f9);
    transition: all 0.25s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--accent, #ee2a7b);
    background: var(--surface, #fff);
    box-shadow: 0 0 0 4px var(--accent-soft, rgba(238, 42, 123, 0.14));
}

.form-group input[type="submit"] {
    width: 100%;
    padding: 14px;
    margin-top: 6px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent, #ee2a7b) 0%, var(--accent-strong, #c00f5d) 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 14px 30px -14px rgba(238, 42, 123, 0.9);
}

.form-group input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 36px -14px rgba(238, 42, 123, 1);
}

.form-group input[type="submit"]:active { transform: translateY(0); }

.alert {
    background-color: rgba(179, 85, 95, 0.12);
    color: #b3555f;
    border: 1px solid rgba(179, 85, 95, 0.3);
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 22px;
    font-size: 14px;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Elegant design tokens (shared) */
:root {
    --bg: #faf6f8;
    --bg-2: #f2e9ee;
    --surface: #ffffff;
    --surface-2: #fbf6f9;
    --ink: #17141a;
    --ink-soft: #6f6772;
    --line: rgba(23, 20, 26, 0.08);
    --accent: #ee2a7b;
    --accent-soft: rgba(238, 42, 123, 0.14);
    --accent-strong: #c00f5d;
    --shadow-md: 0 24px 60px -24px rgba(38, 35, 45, 0.4);
}

body[data-theme="dark"] {
    --bg: #0c0a0e;
    --bg-2: #131016;
    --surface: #16131a;
    --surface-2: #1e1822;
    --ink: #f6eef3;
    --ink-soft: #b09aa8;
    --line: rgba(255, 255, 255, 0.09);
    --accent: #ee2a7b;
    --accent-soft: rgba(238, 42, 123, 0.14);
    --accent-strong: #c00f5d;
    --shadow-md: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
}

/* Push notification management */
body.notifications-page {
    --header-bg: linear-gradient(180deg, #17141a 0%, #0b0a0d 100%);
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(1200px 620px at 12% -12%, rgba(238, 42, 123, 0.12), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    background-attachment: fixed;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.notifications-page .portal-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--header-bg);
    border-bottom: 1px solid rgba(238, 42, 123, 0.35);
    box-shadow: 0 10px 40px -22px rgba(0, 0, 0, 0.7);
    backdrop-filter: none;
}

.notifications-page .header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.notifications-page .header-logo {
    display: inline-flex;
    align-items: center;
}

.notifications-page .header-logo img {
    display: block;
    max-height: 46px;
    filter: brightness(0) invert(1);
}

.notifications-page .header-menu {
    display: flex;
    align-items: center;
    gap: 18px;
}

.notifications-page .header-user {
    color: rgba(244, 240, 233, 0.7);
    font-size: 13px;
}

.notifications-page .header-link {
    padding-bottom: 2px;
    color: #f4f0e9;
    border-bottom: 1px solid rgba(238, 42, 123, 0.6);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
}

.notifications-page .header-link:hover { color: var(--accent); }

.notifications-page .back-row {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 20px 0;
}

.notifications-page .back-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1.5;
    text-decoration: none;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.notifications-page .back-pill:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.notifications-page .theme-switch {
    position: relative;
    width: 58px;
    height: 32px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    cursor: pointer;
    outline: none;
    transition: background 0.3s ease, border-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.notifications-page .theme-switch-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.notifications-page .theme-switch[aria-checked="true"] {
    background: var(--accent);
    border-color: var(--accent);
}

.notifications-page .theme-switch[aria-checked="true"] .theme-switch-knob { transform: translateX(26px); }

.notifications-page .theme-switch-icons {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 7px;
    font-size: 12px;
    line-height: 1;
    pointer-events: none;
}

.notifications-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 20px 64px;
}

.notifications-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.notifications-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--accent-strong);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.notifications-head h1 {
    margin: 0;
    font-family: 'Oswald', sans-serif;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.notifications-head p {
    margin: 5px 0 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.notifications-page .notification {
    margin-bottom: 20px;
    padding: 15px 20px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 2px 10px rgba(23, 20, 26, 0.06);
    font-size: 14px;
}

.notifications-page .notification.is-error { border-left-color: #b3555f; }
.notifications-page .notification.is-success { border-left-color: #2e9e54; }

.notify-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
    gap: 22px;
    align-items: start;
}

.notify-card {
    min-width: 0;
    padding: 24px 26px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 18px 40px -24px rgba(23, 20, 26, 0.32);
}

.notify-card-head {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 20px;
}

.notify-card-icon {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 20px;
    font-weight: 700;
}

.notify-card h2 {
    margin: 0;
    color: var(--ink);
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.35;
}

.notify-card-head p {
    margin: 3px 0 0;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.55;
}

.notify-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notify-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.notify-field label {
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.notify-field input,
.notify-field textarea,
.notify-field select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.notify-field input:focus,
.notify-field textarea:focus,
.notify-field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.notify-field textarea {
    min-height: 132px;
    line-height: 1.55;
    resize: vertical;
}

.notify-field small {
    color: var(--ink-soft);
    font-size: 11px;
}

.notifications-page .notify-form .btn {
    width: 100%;
    margin-top: 3px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: none;
    color: #fff;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.notifications-page .notify-form .btn:hover { background: var(--accent-strong); }

.history-list {
    max-height: 640px;
    margin-right: -8px;
    padding-right: 8px;
    overflow-y: auto;
}

.history-item {
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.history-item:first-child { padding-top: 0; border-top: 0; }

.history-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.history-title-row strong {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
}

.history-target {
    flex: 0 0 auto;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.history-body {
    margin-top: 7px;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 10px;
    color: var(--ink-soft);
    font-size: 11px;
}

.delivery-success { color: #2e9e54; }
.delivery-failed { color: #b3555f; }

.notify-empty {
    padding: 26px 18px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--ink-soft);
    font-size: 13px;
    text-align: center;
}

.template-manager { margin-top: 22px; }

.template-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
    gap: 26px;
    align-items: start;
}

.template-form {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-2);
}

.template-form .notify-field input,
.template-form .notify-field textarea { background: var(--surface); }

.template-list {
    display: flex;
    max-height: 520px;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.template-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface-2);
}

.template-copy { min-width: 0; }

.template-copy strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
}

.template-copy p {
    margin: 5px 0;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.template-copy small {
    color: var(--accent-strong);
    font-size: 10px;
}

.notifications-page .template-item .btn-danger {
    padding: 7px 12px;
    border: 1px solid rgba(184, 61, 75, 0.4);
    border-radius: 999px;
    background: transparent;
    color: #b83d4b;
    box-shadow: none;
    font-size: 11px;
}

.notifications-page .template-item .btn-danger:hover {
    background: rgba(184, 61, 75, 0.1);
}

@media (max-width: 820px) {
    .notify-grid { grid-template-columns: 1fr; }
    .history-list { max-height: none; }
    .template-layout { grid-template-columns: 1fr; }
    .template-list { max-height: none; }
}

@media (max-width: 640px) {
    .notifications-page .header-user { display: none; }
    .notifications-page .header-menu { gap: 12px; }
    .notifications-page .header-link { display: none; }
    .notifications-wrap { padding: 24px 16px 48px; }
    .notifications-page .back-row { padding-right: 16px; padding-left: 16px; }
    .notify-card { padding: 20px 18px; }
    .history-title-row { flex-direction: column; gap: 7px; }
    .template-item { flex-direction: column; }
}

/* Mobile navigation scrolls away with the page instead of covering content. */
@media (max-width: 768px) {
    .portal-header,
    .notifications-page .portal-header {
        position: static !important;
        top: auto !important;
    }
}
