:root{
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --accent-color: #4fc3f7;

    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #f59e0b;

    --background-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333;

    --link-color: #5d8ac7;
    --border-color: #e0e0e0;
    --medium-gray: #9e9e9e;

    --footer-color: #777777;

    --toggle-bg: #e0e0e0;
    --toggle-border: #e0e0e0;
    --toggle-shadow: rgba(0, 0, 0, 0.1);

    --hover-background: rgba(79, 195, 247, 0.10);

    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.30);

    --radius: 10px;
    --radius-pill: 999px;
    --container-max: 1200px;
    color-scheme: dark;
}

[data-theme="dark"]{
    --primary-color: #5d8ac7;
    --secondary-color: #2c7cb0;
    --accent-color: #64d8ff;

    --background-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;

    --footer-color: #777777;

    --toggle-bg: #333333;
    --toggle-border: #333333;
    --toggle-shadow: rgba(0, 0, 0, 0.30);

    --border-color: #333333;
    --medium-gray: #777777;

    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.30);
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html, body{ height: 100%; }

body{
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color .3s ease, color .3s ease;
}

.rehoga-title {
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 12px;

}

.rehoga-logo {
    content: url("/images/logo.png");
    height: 48px;
    width: auto;
}

@media (prefers-color-scheme: dark){
    .rehoga-logo{
        content: url("/images/logo2.png");
    }
}

.container{
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 820px){
    .container{ padding: 1rem; }
}

header{
    position: relative;
    text-align: center;
    margin-bottom: 2rem;
}

.rehoga-title-swap{
    display: block;
    text-align: center;
    margin-bottom: .5rem;
}

@media (max-width: 520px){
    .rehoga-title-swap img{
        height: 36px;
        max-width: 85%;
    }
}

.rehoga-title-swap img{
    height: 56px;
    width: auto;
    display: block;
    margin: 0 auto;
}

/* Default: dark */
.rehoga-title-swap .logo-light{ display:none; }
.rehoga-title-swap .logo-dark{ display:block; }

/* Light per Toggle */
html[data-theme="light"] .rehoga-title-swap .logo-dark{ display:none; }
html[data-theme="light"] .rehoga-title-swap .logo-light{ display:block; }


header h1{
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #111;
}

header h3{
    color: #111;
}

@media (prefers-color-scheme: dark){
    header h1,
    header h3{
        color: #d7dbe0 ;
    }
}

header p{
    color: var(--medium-gray);
}

#theme-toggle{
    position: absolute;
    top: 0;
    right: 0;
    margin: 1rem;
}

.theme-toggle-btn{
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: background-color .3s ease;
}

.theme-toggle-btn:hover{
    background-color: var(--toggle-bg);
}

a{
    color: var(--link-color);
    text-decoration: none;
    transition: opacity .2s ease;
}
a:hover{ opacity: .85; }

.card,
.login-box,
.panel,
.ticket-card{
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
}

.card{ padding: 1.25rem; }
.panel{ padding: 1.25rem; }
.ticket-card{ padding: 1.25rem; }

.card.clickable:hover,
.ticket-card.clickable:hover{
    transform: translateY(-2px);
    transition: transform .2s ease;
}

/* Ticket filters UI */
.ticket-filters {
    margin-top: .75rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.tf-row {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

.tf-row-main {
    justify-content: space-between;
}

.tf-search {
    flex: 1 1 420px;
    min-width: 260px;
    position: relative;
}

.tf-search-input {
    width: 100%;
    padding-right: 2.25rem; /* room for clear button */
}

.tf-clear {
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: .65;
    display: none;
    font-size: 14px;
}

.tf-clear:hover { opacity: 1; }

.tf-toggle {
    white-space: nowrap;
}

.tf-reset {
    white-space: nowrap;
}

.tf-chips {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.tf-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid rgba(127,127,127,.25);
    border-radius: 999px;
    padding: .25rem .5rem;
    font-size: .9rem;
}

.tf-chip-muted {
    opacity: .75;
}

.tf-chip-x {
    text-decoration: none;
    opacity: .7;
    padding: 0 .25rem;
}
.tf-chip-x:hover { opacity: 1; }

.tf-panel {
    border: 1px solid rgba(127,127,127,.2);
    border-radius: 12px;
    padding: .75rem;
}

.tf-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.tf-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.tf-label {
    font-size: .85rem;
    opacity: .75;
}

.tf-hint {
    grid-column: span 1;
}

@media (max-width: 900px) {
    .tf-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
    .tf-row-main { justify-content: flex-start; }
}

@media (max-width: 520px) {
    .tf-grid { grid-template-columns: 1fr; }
}

button,
.btn{
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
}

.btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .7rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
}

.btn:hover{
    background: rgba(127,127,127,.08);
}

.btn-primary{
    background: rgba(79,195,247,.14);
    border-color: rgba(79,195,247,.55);
    color: var(--primary-color);
}

.btn-primary:hover{
    background: rgba(79,195,247,.20);
}

.btn-danger{
    background: rgba(244,67,54,.12);
    border-color: rgba(244,67,54,.45);
    color: var(--danger-color);
}

.btn-success{
    background: rgba(76,175,80,.12);
    border-color: rgba(76,175,80,.45);
    color: var(--success-color);
}

.btn-block{ width: 100%; }

.login-btn{
    width: 100%;
    padding: 12px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;

    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 35px;
}

.login-btn:hover{
    background: var(--primary-color);
    color: #fff;
    opacity: 1;
}

@media (max-width: 768px){
    .login-btn{
        padding: 10px 15px;
        font-size: 0.8rem;
        min-height: 30px;
    }
}


.form-group{
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: .85rem;
}

label{
    font-size: .9rem;
    color: var(--medium-gray);
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea{
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    padding: .65rem .75rem;
    outline: none;
}

textarea{ min-height: 120px; resize: vertical; }

input:focus,
select:focus,
textarea:focus{
    border-color: rgba(79,195,247,.55);
    box-shadow: 0 0 0 4px rgba(79,195,247,.15);
}

select {
    color: var(--text-color, inherit);
}

select option {
    color: #000;
}

select option:disabled {
    color: #666;
}

.portal-toolbar { display: flex; gap: .5rem; align-items: center; }
.portal-toolbar .push-right { margin-left: auto; }



.error-message{
    margin-top: 1rem;
    padding: .75rem;
    border-radius: 8px;
    background-color: rgba(244, 67, 54, 0.10);
    color: var(--danger-color);
    border: 1px solid rgba(244, 67, 54, 0.35);
    font-size: .95rem;
}

.success-message{
    margin-top: 1rem;
    padding: .75rem;
    border-radius: 8px;
    background-color: rgba(76, 175, 80, 0.10);
    color: var(--success-color);
    border: 1px solid rgba(76, 175, 80, 0.35);
    font-size: .95rem;
}

.login-section{
    display: flex;
    justify-content: center;
    margin-top: .5rem;
}

.login-box{
    width: min(520px, 100%);
    padding: 1.25rem;
    text-align: left;
}

.login-box h2{
    margin-bottom: .75rem;
    color: var(--primary-color);
}

.form-footer{
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: var(--medium-gray);
    font-size: .95rem;
}

.signup-link{ font-weight: 600; }

.user-nav{
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.list{
    display: grid;
    gap: 1rem;
}

.table{
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table th, .table td{
    padding: .75rem .85rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.table th{
    color: var(--medium-gray);
    font-weight: 700;
    background: rgba(127,127,127,.06);
}

.table tr:hover td{
    background: rgba(127,127,127,.06);
}

.badge{
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    color: var(--medium-gray);
    font-size: .85rem;
    line-height: 1.2;
    width: fit-content;
}

.badge.open{
    border-color: rgba(244,67,54,.50);
    color: var(--danger-color);
}

.badge.resolved,
.badge.closed{
    border-color: rgba(76,175,80,.50);
    color: var(--success-color);
}

.badge.pending{
    border-color: rgba(245,158,11,.60);
    color: var(--warning-color);
}

.ticket-header{
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}

.ticket-title{
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-color);
}

.ticket-meta{
    color: var(--medium-gray);
    font-size: .9rem;
}

.reply{
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: rgba(127,127,127,.06);
    margin-top: 1rem;
}

.reply .reply-meta{
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    color: var(--medium-gray);
    font-size: .9rem;
    margin-bottom: .5rem;
}

.reply .reply-body{
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

footer{
    text-align: center;
    margin-top: 3rem;
    color: var(--footer-color);
    font-size: .9rem;
}

footer p{ margin-top: .35rem; }

.landing-grid{
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 1rem;
}

@media (min-width: 900px){
    .landing-grid{ grid-template-columns: 1fr 1fr; }
}

.landing-card{
    display: block;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    color: inherit;
    text-decoration: none;
    transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}

.landing-card:hover{
    transform: translateY(-4px);
    border-color: rgba(79,195,247,.55);
    background-color: var(--hover-background);
    cursor: pointer;
}

.landing-card h2{
    margin: 0 0 .5rem 0;
    font-size: 1.35rem;
    color: var(--primary-color);
}

.landing-card p{
    margin: 0 0 1rem 0;
    color: var(--medium-gray);
    line-height: 1.5;
}

.landing-cta{
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .65rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(79,195,247,.55);
    color: var(--accent-color);
    background: rgba(79,195,247,.12);
    font-weight: 600;
    width: fit-content;
}

.landing-card:hover .landing-cta{
    background: rgba(79,195,247,.18);
}

.hero{
    display: grid;
    gap: 1.5rem;
    align-items: stretch;
    margin-top: 1rem;
}

@media (min-width: 900px){
    .hero{
        display: grid;
        grid-template-columns: 1.1fr 1fr;
        gap: 2rem;

        align-items: stretch;
    }

    .hero .landing-grid{
        grid-template-columns: 1fr;
        margin-top: 0;
        height: 100%;
        align-content: stretch;
    }

    .hero-copy{
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .hero-actions{
        margin-top: auto;
    }

    .hero .landing-card{
        height: 100%;
    }
}

.hero-copy{
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
}

.hero-copy h2{
    color: var(--primary-color);
    font-size: 1.6rem;
    line-height: 1.2;
    margin-bottom: .75rem;
}

.hero-copy p{
    color: var(--medium-gray);
    margin-bottom: 1rem;
}

.hero-bullets{
    list-style: none;
    display: grid;
    gap: .65rem;
    margin: 0 0 1.25rem 0;
    padding: 0;
}

.hero-bullets li{
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    color: var(--text-color);
}

.hero-bullets .dot{
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: .35rem;
    background: rgba(79,195,247,.45);
    border: 1px solid rgba(79,195,247,.55);
    flex: 0 0 auto;
}

.hero-actions{
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
}



.hero-actions .btn{
    text-decoration: none;
}


.form-actions{
    margin-top: 1.25rem;
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
}

a.login-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.login-box p{
    margin-top: .75rem;
    margin-bottom: 1.75rem;
}

.portal-nav{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;

    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--box-shadow);

    padding: .75rem 1rem;
    margin: 0 0 1.25rem 0;
}

.portal-nav .nav-left,
.portal-nav .nav-right{
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

.portal-nav a{
    text-decoration: none;
    color: inherit;
}

.portal-nav .nav-link{
    padding: .35rem .65rem;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    color: var(--medium-gray);
}

.portal-nav .nav-link:hover{
    border-color: rgba(79,195,247,.35);
    background: var(--hover-background);
    color: var(--text-color);
}

.portal-nav .nav-link.active{
    border-color: rgba(79,195,247,.55);
    background: rgba(79,195,247,.12);
    color: var(--accent-color);
    font-weight: 600;
}

.btn,
a.btn,
button.btn {
    display: inline-block;
    padding: .55rem .9rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.2;
    font-weight: 500;
    transition: opacity .2s ease, background-color .2s ease, border-color .2s ease;
    font-family: inherit;
}

.btn:hover { opacity: .9; }

.btn-primary {
    border-color: rgba(93, 138, 199, .55);
}

.btn-ghost {
    border: 1px solid var(--border-color);
    background: transparent;
}

button.btn { appearance: none; -webkit-appearance: none; }

header { position: relative; }
.header-actions{
    position: absolute;
    top: 0;
    right: 0;
    margin: 1rem;
    display: inline-flex;
    gap: .65rem;
    align-items: center;
}

.btn-logout{
    padding: .45rem .8rem;
    border-radius: 10px;
}

.theme-toggle-btn{ margin-left: 0; }

.portal-header{ position: relative; }

.portal-header .header-actions{
    position: absolute;
    top: 0;
    right: 0;
    margin: 1rem;

    display: inline-flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.portal-header .header-actions #theme-toggle{
    position: static !important;
    margin: 0 !important;
}

.portal-header .header-actions .header-logout{
    margin: 0 !important;
}

.portal-nav,
.portal-toolbar{
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.portal-toolbar{
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin: 0 0 1rem 0;
}

.portal-toolbar a[aria-current="page"]{
    background: transparent !important;
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.kebab-wrap{
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
}

.kebab-btn{
    appearance: none;
    -webkit-appearance: none;
    font: inherit;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    padding: 0;
    margin: 0;

    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-color);

    line-height: 1;
    cursor: pointer;

    transition: opacity .2s ease, background-color .2s ease, border-color .2s ease;
    user-select: none;
}

.kebab-btn:hover{
    background: rgba(127,127,127,.08);
}

.kebab-btn[aria-expanded="true"]{
    border-color: rgba(79,195,247,.55);
    background: rgba(79,195,247,.12);
}

.kebab-btn:focus-visible{
    outline: none;
    box-shadow: 0 0 0 4px rgba(79,195,247,.15);
}

.kebab-btn{
    font-size: 18px;
}

.kebab-menu{
    position: fixed;
    z-index: 10000;

    min-width: 180px;
    width: max-content;
    max-width: min(320px, calc(100vw - 16px));

    padding: .35rem;
    border-radius: 10px;

    border: 1px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: var(--box-shadow);

    color: var(--text-color);

    user-select: none;
}

.kebab-menu[hidden]{
    display: none !important;
}

.kebab-menu .kebab-item{
    appearance: none;
    -webkit-appearance: none;
    font: inherit;

    display: flex;
    align-items: center;
    gap: .5rem;

    width: 100%;
    box-sizing: border-box;

    text-align: left;
    padding: .50rem .65rem;

    border-radius: 8px;

    background: transparent;
    border: 0;

    color: inherit;
    cursor: pointer;
    text-decoration: none;

    line-height: 1.2;
    white-space: nowrap;
}

.kebab-menu a.kebab-item,
.kebab-menu button.kebab-item{
    display: flex;
}

.kebab-menu .kebab-item:hover{
    background: rgba(127,127,127,.08);
}

.kebab-menu .kebab-item:focus-visible{
    outline: none;
    box-shadow: 0 0 0 4px rgba(79,195,247,.15);
}

.kebab-menu .kebab-item:disabled{
    opacity: .55;
    cursor: not-allowed;
}

.kebab-menu .kebab-item.is-danger{
    color: var(--danger-color);
}

.kebab-menu .kebab-sep{
    height: 1px;
    margin: .35rem 0;
    background: rgba(127,127,127,.20);
    border-radius: 999px;
}

.kebab-menu form{
    margin: 0 !important;
    padding: 0 !important;
}

.kebab-menu{
    transform-origin: top right;
}

.helpdesk-article-wrap{
    margin-top: 1rem;
}

.helpdesk-article-card{
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: calc(var(--radius) - 2px);
    box-shadow: var(--box-shadow);
    padding: 1.25rem 1.25rem;
}

.helpdesk-article-card{
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.helpdesk-prose{
    line-height: 1.65;
}

.helpdesk-prose h2{
    margin: 1.2rem 0 .6rem;
    line-height: 1.25;
}
.helpdesk-prose h2:first-child{
    margin-top: 0;
}

.helpdesk-prose ul,
.helpdesk-prose ol{
    margin: .6rem 0 1rem;
    padding-left: 1.35rem;
}

.helpdesk-prose li{
    margin: .35rem 0;
}

.helpdesk-prose li > ul,
.helpdesk-prose li > ol{
    margin-top: .4rem;
    margin-bottom: .2rem;
}

.helpdesk-prose strong{
    color: var(--text-color);
}

.helpdesk-prose p{
    margin: .6rem 0;
}

@media (max-width: 480px){
    .portal-header .header-actions{ margin: .5rem; gap: .5rem; }
}

@media (max-width: 480px){
    header{ margin-bottom: 1.25rem; }
    header h1{ font-size: 1.8rem; margin-bottom: .5rem; }
    #theme-toggle{ margin: .5rem; }
    .form-footer{ flex-direction: column; align-items: flex-start; }
}
