:root {
    --primary-dark: #031a3c;
    --primary: #063f7c;
    --primary-light: #0a6bc2;
    --accent: #9adf50;
    --accent-strong: #6fbf2e;
    --text-light: #f4f7fb;
    --card: rgba(3, 26, 60, 0.82);
    --card-border: rgba(255, 255, 255, 0.15);
    --danger: #f05a5a;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

* {
    box-sizing: border-box;
}

.page-shell {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, #0a6bc2 0%, #031a3c 60%);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.login-wrapper, .dashboard-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
}

.page-content {
    width: 100%;
}

.login-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
}

.logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo img {
    max-width: 180px;
}

.company-label {
    margin: 0.2rem 0 0;
    font-size: 0.58rem;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
}

h1 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.15;
}

p.subtitle {
    text-align: center;
    margin: 0 0 1.5rem;
    color: rgba(255, 255, 255, 0.7);
}

form label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.62rem;
    letter-spacing: 0.5px;
}

form input, form select, form textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    padding: 0.68rem 0.8rem;
    font-size: 0.68rem;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.8) 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.8) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2.2rem;
}

form select::-ms-expand {
    display: none;
}

form select option {
    background: #10284b;
    color: #f4f7fb;
}

form input:focus, form select:focus, form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(154, 223, 80, 0.2);
}

button {
    width: 100%;
    padding: 0.76rem;
    border: none;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #0c2c43;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.25);
}

.flash {
    border-radius: 14px;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.flash-success {
    background: rgba(154, 223, 80, 0.1);
    color: var(--accent);
}

.flash-error {
    background: rgba(240, 90, 90, 0.15);
    color: #ffb3b3;
}

.error {
    background: rgba(240, 90, 90, 0.1);
    border: 1px solid rgba(240, 90, 90, 0.4);
    color: #ffd2d2;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.dashboard-layout {
    max-width: 1100px;
    width: 100%;
    flex: 1;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    padding: 2rem;
}

.sidebar {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar .user-info {
    text-align: center;
}

.sidebar .user-info h2 {
    margin: 0.5rem 0 0;
    font-size: 0.62rem;
    line-height: 1.15;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-nav a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.65rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: border 0.2s ease, background 0.2s ease;
}

.sidebar-nav a:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav a.active {
    border-color: rgba(154, 223, 80, 0.6);
    background: rgba(154, 223, 80, 0.12);
    color: var(--accent);
}

.sidebar .stats {
    display: grid;
    gap: 0.6rem;
}

.stat-card {
    padding: 0.8rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card span {
    display: block;
    font-size: 0.58rem;
    opacity: 0.75;
}

.stat-card strong {
    font-size: 1.02rem;
}

.main-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.site-footer {
    width: 100%;
    margin-top: auto;
    padding: 1.25rem 1rem;
}

.site-footer__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 0.85rem;
    background: rgba(3, 26, 60, 0.9);
    text-align: center;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.72);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
}

.site-footer__inner a {
    color: inherit;
    text-decoration: underline;
}

.site-footer__inner a:hover {
    color: #ffffff;
}

.admin-layout {
    max-width: 1200px;
}

.admin-panels {
    gap: 2rem;
}

.panel {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
}

.panel h3 {
    margin: 0 0 1rem;
    font-size: 0.92rem;
    line-height: 1.1;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.panel-header h3 {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.1;
}

.panel-header .link-btn {
    font-size: 0.62rem;
    text-decoration: none;
    color: var(--text-light);
    padding: 0.28rem 0.68rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: border 0.2s ease, background 0.2s ease;
}

.panel-header .link-btn:hover {
    border-color: rgba(154, 223, 80, 0.5);
    background: rgba(154, 223, 80, 0.12);
}

.inline-form {
    margin: 0;
}

.table-btn {
    width: auto;
    padding: 0.32rem 0.72rem;
    font-size: 0.49rem;
}

.table-btn.ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
    margin-left: 0.5rem;
}

.editing-row {
    background: rgba(154, 223, 80, 0.08);
}

.ticket-table {
    width: 100%;
    border-collapse: collapse;
}

.ticket-table th,
.ticket-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    font-size: 0.58rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    font-size: 0.49rem;
    font-weight: 600;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.badge.open {
    background: rgba(154, 223, 80, 0.2);
    color: var(--accent);
}

.badge.in_progress {
    background: rgba(250, 181, 21, 0.18);
    color: #fcbf49;
}

.badge.resolved {
    background: rgba(240, 90, 90, 0.18);
    color: var(--danger);
}

.badge.reopened {
    background: rgba(86, 165, 255, 0.18);
    color: #8bc2ff;
}

.badge.closed {
    background: rgba(180, 180, 180, 0.18);
    color: #d7dbe2;
}

.ticket-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.ticket-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 160px));
    justify-content: start;
    width: fit-content;
    max-width: 100%;
    gap: 0.75rem;
    margin: 1rem 0 1.25rem;
    align-items: end;
}

.ticket-filter-item {
    min-width: 0;
}

.ticket-filter-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    grid-column: 1 / -1;
}

.ticket-filter-actions .link-btn {
    width: auto;
    white-space: nowrap;
}

.ticket-filter-actions button {
    width: auto;
    min-width: 120px;
}

.ghost-action-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
    box-shadow: none;
}

.ghost-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

@media (max-width: 960px) {
    .ticket-filter-grid {
        grid-template-columns: 1fr;
    }
}

.company-form-grid,
.user-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.company-form-grid button,
.user-form-grid button {
    grid-column: 1 / -1;
}

.user-form-grid small {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.51rem;
    color: rgba(255, 255, 255, 0.7);
}

.ticket-form-grid textarea {
    grid-column: 1 / -1;
    min-height: 120px;
}

.table-scroll {
    overflow-x: auto;
}

.list-pagination {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.list-pagination__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

.list-pagination__item {
    display: flex;
}

.list-pagination__item + .list-pagination__item {
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.list-pagination__link,
.list-pagination__ellipsis {
    min-width: 42px;
    padding: 0.72rem 0.9rem;
    text-align: center;
    font-size: 0.68rem;
    line-height: 1;
    color: var(--text-light);
    text-decoration: none;
    background: transparent;
}

.list-pagination__link {
    transition: background 0.2s ease, color 0.2s ease;
}

.list-pagination__link:hover {
    background: rgba(255, 255, 255, 0.08);
}

.list-pagination__item.is-active .list-pagination__link {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: #ffffff;
    font-weight: 700;
}

.list-pagination__item.is-disabled .list-pagination__link {
    color: rgba(255, 255, 255, 0.45);
    pointer-events: none;
}

.list-pagination__item.is-ellipsis .list-pagination__ellipsis {
    color: rgba(255, 255, 255, 0.68);
}

.logout-btn {
    margin-top: auto;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 960px) {
    .page-shell {
        padding: 2rem 1rem;
    }
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        flex-direction: row;
        gap: 1rem;
        align-items: center;
    }
    .sidebar .stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .admin-panels {
        gap: 1.5rem;
    }
}

@media (max-width: 640px) {
    .sidebar {
        flex-direction: column;
    }
    .sidebar .stats {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}
