/* Base — Dark Theme Foundation
   Universal styles for all surfaces (client, admin, webshop).
   Loaded after tokens.css. Uses --r-* design tokens. */

/* ── Body ── */
html {
    height: 100%;
}

body {
    background-color: var(--r-bg);
    color: var(--r-text);
    font-family: var(--r-font);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ── */
h1, h2, h3 {
    color: var(--r-text);
    font-family: var(--r-font);
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: 1.75rem; margin-bottom: 0.5em; }
h2 { font-size: 1.35rem; margin-bottom: 0.4em; }
h3 { font-size: 1.15rem; margin-bottom: 0.3em; }

/* Cufon heading classes — now rendered with Inter */
.cufon_head {
    color: var(--r-text) !important;
    font-family: var(--r-font) !important;
    font-size: 1.75rem !important;
    font-weight: 700;
    margin-bottom: 0.5em;
}

h3.cufon_head {
    font-size: 1.35rem !important;
}

.cufon_head2 {
    color: var(--r-text) !important;
    font-family: var(--r-font) !important;
    font-size: 2.5rem !important;
    font-weight: 800;
    text-shadow: none;
    margin: 0 0 0.3em;
}

.cufon_head3 {
    color: var(--r-text) !important;
    font-family: var(--r-font) !important;
    font-size: 1.75rem !important;
    font-weight: 700;
    margin-bottom: 0.7em;
}

.cufon_fieldset_head {
    color: var(--r-text) !important;
    font-family: var(--r-font) !important;
    font-weight: 600;
}

/* Hide the Cufon loading trick — no longer needed */
.cufon-loading h1 {
    visibility: visible !important;
}

p, td, th {
    font-size: 1rem;
    color: var(--r-text-secondary);
}

/* ── Universal form elements (not just inside fieldsets) ── */
input, textarea, select, button {
    font-family: var(--r-font);
    color: var(--r-text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
    background: var(--r-bg);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-sm);
    color: var(--r-text);
    font-family: var(--r-font);
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    border-color: var(--r-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 120, 179, 0.2);
}

/* ── Tables ── */
table {
    background: transparent;
    border-collapse: collapse;
    width: 100%;
}

table th {
    color: var(--r-text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--r-border);
    white-space: nowrap;
}

table td {
    color: var(--r-text);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--r-border);
    vertical-align: middle;
}

table tr {
    background: transparent;
}

table.display thead,
table.dataTable thead,
.grid thead {
    background: var(--r-elevated);
}

/* DataTables — flat row background */
table.display tbody tr,
table.dataTable tbody tr,
.grid tbody tr {
    background-color: var(--r-hover);
}

table tbody tr:last-child td {
    border-bottom: none;
}

p {
    margin-bottom: 1em;
}

strong, b {
    font-weight: 600;
    color: var(--r-text);
}

small {
    font-size: 0.85em;
}

/* ── Links ── */
a {
    color: var(--r-primary-bright, var(--r-primary));
    text-decoration: none;
    font-weight: 700;
    transition: color var(--r-transition);
}

a:hover,
a:focus {
    color: var(--r-link-hover);
    text-decoration: underline;
}

a:active {
    opacity: 0.8;
}

a:focus,
a:active,
input:focus,
input:active {
    outline: none;
}

/* ── Buttons ── */
.button,
.button:visited,
input[type="submit"],
input[type="reset"],
input[type="button"] {
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font-weight: 600;
    font-family: var(--r-font);
    font-size: 0.95rem;
    line-height: 1;
    outline: none;
    padding: 0.6em 1.2em;
    text-align: center;
    text-decoration: none;
    text-shadow: none;
    border: 1px solid transparent;
    border-radius: var(--r-radius-sm);
    background: var(--r-elevated);
    box-shadow: none;
    transition: all var(--r-transition);
    -webkit-user-select: none;
    user-select: none;
}

.button:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
input[type="button"]:hover {
    text-decoration: none;
    text-shadow: none !important;
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.button:active,
input[type="submit"]:active {
    filter: brightness(0.9);
    transform: translateY(0);
}

button[disabled],
input[type="submit"][disabled],
input[type="reset"][disabled],
input[type="button"][disabled],
.button[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    filter: none !important;
}

/* Size variants */
.xsmall.button, .xsmall.button:visited { font-size: 0.75rem; padding: 0.4em 0.8em; text-shadow: none; }
.small.button, .small.button:visited { font-size: 0.85rem; padding: 0.5em 1em; text-shadow: none; }
.medium.button, .medium.button:visited { font-size: 0.95rem; }
.large.button, .large.button:visited { font-size: 1.1rem; padding: 0.7em 1.4em; }

/* Color variants — flat dark theme, no gradients, no IE filters */
.blue,
.blue:visited {
    background: var(--r-primary) !important;
    border-color: var(--r-primary-dark) !important;
    color: #fff;
    filter: none;
    box-shadow: 0 4px 12px rgba(0, 120, 179, 0.3);
}
.blue:hover { background: var(--r-primary-bright) !important; color: #fff !important; box-shadow: 0 6px 20px rgba(0, 120, 179, 0.4); }
.blue:active { background: var(--r-primary-dark) !important; color: #ddd !important; }

.red,
.red:visited {
    background: var(--r-danger) !important;
    border-color: #b91c1c !important;
    color: #fff;
    filter: none;
}
.red:hover { background: #dc2626 !important; }
.red:active { background: #b91c1c !important; }

.gradient,
.gradient:visited {
    background: var(--r-gradient) !important;
    border: none !important;
    color: #fff;
    filter: none;
    box-shadow: 0 4px 12px rgba(0, 120, 179, 0.3);
}
.gradient:hover { filter: brightness(1.15); box-shadow: 0 6px 20px rgba(0, 120, 179, 0.4); }
.gradient:active { filter: brightness(0.9); }

.green,
.green:visited {
    background: var(--r-success) !important;
    border-color: #059669 !important;
    color: #fff;
    filter: none;
}
.green:hover { background: #059669 !important; }
.green:active { background: #047857 !important; }

.gray,
.gray:visited,
.grey,
.grey:visited {
    background: var(--r-elevated) !important;
    border-color: var(--r-border) !important;
    color: var(--r-text) !important;
    filter: none;
}
.gray:hover, .grey:hover { background: var(--r-hover) !important; color: #fff !important; }
.gray:active, .grey:active { background: var(--r-border) !important; }

.black,
.black:visited {
    background: #1a1a1a !important;
    border-color: #333 !important;
    color: #fff !important;
    filter: none;
}
.black:hover { background: #333 !important; color: #eee !important; }
.black:active { background: #000 !important; }

.white,
.white:visited {
    background: var(--r-card) !important;
    border-color: var(--r-border) !important;
    color: var(--r-text) !important;
    filter: none;
}
.white:hover { background: var(--r-elevated) !important; }
.white:active { background: var(--r-hover) !important; }

.dark-grey,
.dark-grey:visited {
    background: #333 !important;
    border-color: #555 !important;
    color: #fff !important;
    filter: none;
}
.dark-grey:hover { background: #444 !important; }

/* ── Notifications / Messages ── */
div.message_js,
div.message {
    background: var(--r-card);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-sm);
    box-shadow: var(--r-shadow-lg);
    color: var(--r-text-secondary);
    display: none;
    font-size: 0.95rem;
    padding: 12px 16px;
    position: fixed;
    top: 70px;
    left: 1rem;
    right: 1rem;
    width: auto;
    max-width: 380px;
    z-index: 9999;
    text-align: center;
}

div.message_js {
    cursor: default;
    position: relative;
    top: 0;
    left: 0;
    transform: none;
}

div.message_js h4,
div.message h4 {
    background: none;
    color: var(--r-warning);
    font-family: var(--r-font);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3em;
    padding-left: 0;
}

div.message_js p,
div.message_js li,
div.message p,
div.message li {
    margin-left: 0;
    padding: 0 !important;
    color: var(--r-text-secondary);
}

div.message_js .validation_errors,
div.message .validation_errors {
    margin-top: 4px;
}

div.message_js .validation_errors li,
div.message .validation_errors li {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Success notification */
div.notification_success {
    background: rgba(16, 185, 129, 0.45);
    border-color: var(--r-success);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

div.notification_success h4 {
    background: none;
    color: var(--r-success);
}

/* Error notification */
div.notification_error {
    background: rgba(239, 68, 68, 0.45);
    border-color: var(--r-danger);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

div.notification_error h4 {
    background: none;
    color: #ffffff;
}

div.notification_error p,
div.notification_error li {
    color: rgba(255, 255, 255, 0.8);
}

/* Announcement notification */
div.notification_announcement {
    background: rgba(0, 120, 179, 0.45);
    border-color: var(--r-primary);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

div.notification_announcement h4 {
    background: none;
    color: var(--r-primary-bright);
}

@media screen and (max-width: 768px) {
    div.message_js,
    div.message {
        max-width: none;
    }
}

/* ── Warning / Info boxes ── */
div.warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--r-warning);
    border-radius: var(--r-radius-sm);
    color: var(--r-warning);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 16px;
}

.special {
    background-color: var(--r-elevated);
    border: none;
    border-left: 4px solid var(--r-primary);
    border-radius: 0 var(--r-radius-sm) var(--r-radius-sm) 0;
    margin: 0 0 20px;
    padding: 1.25rem 1.5rem;
    text-shadow: none;
    color: var(--r-text-secondary);
}

/* ── Promo boxes (sidebar) ── */
.box_promo {
    display: block;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--r-elevated);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-sm);
    color: var(--r-text-secondary);
    text-decoration: none;
    background-image: none;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.5;
}

a.box_promo:hover,
a.box_promo:focus {
    color: var(--r-text-secondary);
    text-decoration: none;
    background: var(--r-hover);
}

a.box_promo:hover strong,
a.box_promo:focus strong {
    color: var(--r-primary-bright);
}

.box_promo strong {
    color: var(--r-primary-bright);
    display: block;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

/* ── Utility classes ── */
.round { border-radius: 5px; }
.round2 { border-radius: 4px; }
.round3 { border-radius: 10px; }
.round4 { border-radius: 2px; }

.left { float: left; }
.right { float: right; }
.hidden { display: none; visibility: hidden; }

.help,
b.help,
span.help,
span a .help {
    color: var(--r-text-muted);
    cursor: help;
    font-weight: 600;
    letter-spacing: 1px;
    line-height: 1;
}

ul.list-default {
    list-style: disc outside none !important;
    padding: 0 0 0 30px;
    margin: 0;
}

ul.list-default li {
    list-style: inherit !important;
    display: list-item !important;
    margin-left: 6px !important;
    padding: 0 0 0 10px !important;
}

/* Row status classes */
tr.inactive {
    background-color: rgba(239, 68, 68, 0.15) !important;
}

tr.inactive td {
    background-color: rgba(239, 68, 68, 0.15) !important;
}

/* Status utility classes */
.r-status-active { color: var(--r-success); }
.r-status-inactive { color: var(--r-danger); }
.r-status-warning { color: var(--r-warning); }

/* Status badges — pill-shaped with colored backgrounds */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--r-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--r-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--r-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-primary {
    background: rgba(0, 120, 179, 0.15);
    color: var(--r-primary);
    border: 1px solid rgba(0, 120, 179, 0.3);
}

/* ── Alert boxes (inline, non-dismissible) ── */
.r-alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 2px solid var(--r-danger);
    border-radius: var(--r-radius-sm);
    padding: 15px;
    margin: 20px 0;
}

.r-alert-danger h4 {
    color: var(--r-danger);
    margin: 0 0 10px 0;
}

.r-alert-danger p {
    color: var(--r-text-secondary);
    margin: 0 0 10px 0;
}

.r-alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid var(--r-warning);
    border-radius: var(--r-radius-sm);
    padding: 12px;
    margin: 10px 0;
}

.r-alert-warning p,
.r-alert-warning li {
    color: var(--r-text-secondary);
}

.r-alert-warning .r-alert-toggle {
    cursor: pointer;
    color: var(--r-warning);
    font-weight: bold;
    user-select: none;
}

.r-alert-warning .r-alert-toggle:hover {
    text-decoration: underline;
}

.r-alert-warning .r-alert-details {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.6;
}

.r-alert-warning .r-alert-details p {
    font-size: 13px;
}

.r-alert-warning .r-alert-details ul {
    padding-left: 20px;
}

.r-alert-warning .r-alert-details li {
    display: list-item !important;
    list-style-type: disc !important;
    list-style-position: outside !important;
    background: none !important;
    border: none !important;
    padding: 2px 0 !important;
    margin: 0 0 0 20px !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
}

/* ── Inline code ── */
code {
    background: var(--r-elevated);
    padding: 4px 8px;
    border: 1px solid var(--r-border);
    border-radius: 3px;
    font-family: monospace;
    font-size: 14px;
    color: var(--r-text);
}

/* ── Pre-formatted text ── */
pre {
    background: var(--r-elevated);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-sm);
    color: var(--r-text-secondary);
    font-family: monospace;
    font-size: 0.85rem;
    padding: 1rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ── Muted text utility ── */
.r-text-muted {
    color: var(--r-text-muted) !important;
}

.r-text-secondary {
    color: var(--r-text-secondary) !important;
}

.r-text-sm {
    font-size: 11px;
}

/* ================================================================
   Login page (standalone, uses empty.php layout)
   ================================================================ */
/* Override content_wrapper when login page is present */
#content_wrapper:has(.login-page) {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 6vh 1rem 2rem;
}

.login-page {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--r-font);
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--r-text);
    margin: 0 0 0.4rem;
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--r-text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.login-page #login_form_wrapper {
    background: var(--r-card);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

/* Reset fieldset inside login card */
.login-page #login_form_wrapper fieldset,
.login-page #login_form form {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    max-width: none;
    box-shadow: none;
}

.login-field {
    margin-bottom: 1.25rem;
}

.login-field label {
    display: block !important;
    float: none !important;
    text-align: left !important;
    width: auto !important;
    padding: 0 !important;
    color: var(--r-text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.login-field input {
    width: 100% !important;
    float: none !important;
    padding: 0.65rem 0.85rem;
    background: var(--r-elevated);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-sm);
    color: var(--r-text);
    font-family: var(--r-font);
    font-size: 0.9rem;
    transition: border-color var(--r-transition), box-shadow var(--r-transition);
    box-sizing: border-box;
}

.login-field input:focus {
    outline: none;
    border-color: var(--r-primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 179, 0.2);
}

.login-field input::placeholder {
    color: var(--r-text-muted);
}

.login-submit {
    width: 100%;
    padding: 0.7rem;
    background: var(--r-gradient);
    border: none;
    border-radius: var(--r-radius-sm);
    color: #fff;
    font-family: var(--r-font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--r-transition), box-shadow var(--r-transition);
    margin-top: 0.25rem;
}

.login-submit:hover {
    opacity: 0.9;
    box-shadow: var(--r-glow-strong);
}

.login-forgot {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--r-border);
}

.login-forgot a {
    color: var(--r-text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: color var(--r-transition);
}

.login-forgot a:hover {
    color: var(--r-primary-bright);
    text-decoration: underline;
}

/* Quick links row below login card */
.login-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.login-link-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem;
    background: var(--r-card);
    border: 1px solid var(--r-border);
    border-radius: var(--r-radius-sm);
    text-decoration: none;
    transition: border-color var(--r-transition), background var(--r-transition);
}

.login-link-card:hover {
    background: var(--r-elevated);
    border-color: var(--r-border-hover);
    text-decoration: none;
}

.login-link-card i {
    font-size: 1.1rem;
    color: var(--r-primary-bright);
    flex-shrink: 0;
}

.login-link-card strong {
    display: block;
    color: var(--r-text);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
}

.login-link-card span {
    display: block;
    color: var(--r-text-muted);
    font-size: 0.7rem;
    line-height: 1.3;
}

@media (max-width: 480px) {
    .login-links {
        grid-template-columns: 1fr;
    }
    .login-card {
        max-width: 100%;
    }
    #login_form_wrapper {
        padding: 1.5rem;
    }
}

/* ── Notifications container ── */
#notifications {
    position: fixed;
    top: 1em;
    z-index: 10;
    width: 100%;
    pointer-events: none;
}

#notifications > * {
    pointer-events: auto;
}
