/* Import fonts for all pages */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300..800&display=swap');

/* ========================================
   GLOBAL STYLES
   ======================================== */
* {
    font-family: 'Open Sans', sans-serif;
}

body, html {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
}

/* ========================================
   HEADER
   ======================================== */
#header {
    background: #ffffff;
    padding: 15px 0;
    border: none;
    box-shadow: none;
}

.header-container {
    max-width: none;
    margin: 0;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.header-logo {
    padding: 10px 0;
}

.header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    max-height: 70px;
    width: auto;
    object-fit: contain;
    padding: 5px 20px 5px 0;
}

/* User Actions Section */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Guest Info - Static label */
.guest-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.125rem;
    color: #666;
    padding: 8px 12px;
    border-radius: 8px;
}

.guest-info:hover {
    color: #000;
}

.guest-info .icon-user {
    filter: brightness(0) saturate(100%) invert(40%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(95%) contrast(90%);
    transition: filter 0.3s ease;
}

.guest-info:hover .icon-user {
    filter: brightness(0);
}

.guest-text {
    font-weight: 400;
    font-size: 1.125rem;
    transition: color 0.3s ease;
}

/* Icons */
.icon-user {
    width: 20px;
    height: 20px;
    object-fit: contain;
    transition: filter 0.3s ease;
}

/* Sign In Button */
#header .header-actions a.btn-signin {
    background: #FDC403;
    color: #000;
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 1.0625rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(253, 196, 3, 0.3);
    white-space: nowrap;
    line-height: normal;
    vertical-align: middle;
}

#header .header-actions a.btn-signin:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(253, 196, 3, 0.4);
    text-decoration: none;
    color: #000;
    background: #FDC403;
}

#header .header-actions a.btn-signin .btn-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0);
    flex-shrink: 0;
    display: inline-block;
}

/* User Dropdown Menu */
.user-dropdown {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.25rem;
    color: #000;
    transition: all 0.3s ease;
}

.user-menu-trigger:hover {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #FDC403;
}

.user-menu-trigger:hover .user-name {
    color: #FDC403;
}

.user-menu-trigger .icon-user {
    width: 26px;
    height: 26px;
    transition: filter 0.3s ease;
    filter: brightness(0) saturate(0%) invert(40%);
}

.user-menu-trigger:hover .icon-user {
    filter: brightness(0) saturate(100%) invert(77%) sepia(73%) saturate(450%) hue-rotate(359deg) brightness(101%) contrast(98%);
}

.user-menu-trigger .user-name {
    font-weight: 500;
    font-size: 1.25rem;
    color: #666666;
    transition: color 0.3s ease;
}

.dropdown-arrow {
    font-size: 0.75rem;
    color: #666666;
    transition: all 0.3s ease;
}

.user-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
    color: #FDC403;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #FDC403;
}

/* Mobile User Icon */
.mobile-user-icon {
    display: none;
    align-items: center;
    padding: 8px 0 8px 8px;
}

.mobile-user-icon .icon-user {
    width: 28px;
    height: 28px;
    filter: brightness(0) saturate(0%) invert(40%);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 8px 8px 4px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle .menu-icon {
    width: 28px;
    height: 28px;
    filter: brightness(0);
}

.mobile-menu-toggle:hover .menu-icon {
    filter: brightness(0) saturate(100%) invert(77%) sepia(73%) saturate(450%) hue-rotate(359deg) brightness(101%) contrast(98%);
}

/* ========================================
   NAVIGATION BAR (tickets.php, dashboard.php, view.php)
   ======================================== */
#nav {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 0;
    margin: 24px auto 48px;
    max-width: fit-content;
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

#nav li {
    display: inline-block;
    margin: 0;
    padding: 0;
    position: relative;
}

/* Divider between first two items */
#nav li:first-child::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 24px;
    background: rgba(0, 0, 0, 0.08);
}

#nav li a {
    display: block;
    padding: 16px 32px;
    color: #717182;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    border-radius: 0;
    white-space: nowrap;
    position: relative;
}

/* Hover effect for non-active items */
#nav li a:hover {
    color: #000;
    background: rgba(0, 0, 0, 0.02);
}

/* Active state for regular tabs (with bottom indicator) */
#nav li a.active {
    color: #000;
    background: transparent;
}

/* Bottom indicator for active regular tabs */
#nav li a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #FFC107;
}

/* Triangle/notch below active indicator */
#nav li a.active::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #FFC107;
}

/* Last item is the yellow primary button */
#nav li:last-child {
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}

#nav li:last-child a {
    background: #FFC107;
    color: #000;
    font-weight: 700;
}

#nav li:last-child a:hover {
    background: #FFB300;
    color: #000;
}

/* Remove indicator styles from last item */
#nav li:last-child a.active::after,
#nav li:last-child a.active::before {
    display: none !important;
}

/* ========================================
   FOOTER
   ======================================== */
#footer {
    text-align: center;
    padding: 20px;
    font-size: 0.8125rem;
    color: #888;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
}

#footer a {
    color: #FDC403;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

#footer a:hover {
    color: #e6b003;
    text-decoration: underline;
}

/* Hide loading overlay */
#overlay,
#loading {
    display: none !important;
}

/* ========================================
   PAGE TITLES
   ======================================== */
#content > h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 0.5rem 0;
    text-align: left;
}

#content > h1::after {
    content: '';
    display: block;
    width: 3.75rem;
    height: 0.25rem;
    background: #FDC403;
    border-radius: 0.125rem;
    margin: 1rem 0 1.25rem;
}

#content > p {
    font-size: 0.9375rem;
    color: #666;
    margin-bottom: 2.1875rem;
    text-align: left;
    line-height: 1.6;
}

/* ========================================
   SECTION HEADERS
   ======================================== */
h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 0.375rem 0;
    border: none;
}

/* ========================================
   HIDE HR LINES
   ======================================== */
hr {
    display: none !important;
}

/* ========================================
   ALERT / MESSAGE BOXES
   ======================================== */
#msg_error,
.error-message,
#msg_warning {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    background: #fdf2f2;
    border: 1px solid #e8b4b4;
    border-left: 4px solid #c0392b;
    color: #7a2020;
}

#msg_notice,
.success-message,
#msg_info {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    background: #fffbf0;
    border: 1px solid #fdc403;
    border-left: 4px solid #fdc403;
    color: #333;
}

/* ========================================
   FORM TABLES (register, profile pages)
   ======================================== */
table.padded,
table.profile-settings,
.register-form table {
    width: 100%;
    border: none;
    border-collapse: collapse;
}

table.padded tbody {
    display: block;
}

table.padded tr,
table.profile-settings tr,
.register-form table tr {
    display: block;
    margin-bottom: 24px;
}

table.padded td,
table.profile-settings td,
.register-form table td {
    display: block;
    border: none;
    padding: 0;
}

/* Table cell labels */
table.padded td[width="180"],
table.profile-settings td[width="180"],
.register-form table td[width="180"] {
    font-weight: 600;
    color: #222;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

/* Universal label spacing for all forms (including table-based) */
label {
    display: block;
    margin-bottom: 10px;
}

/* Add space between label text and input field for inline labels */
table label,
form label {
    display: block;
    margin-bottom: 10px;
}

/* Ensure inputs have some top margin when following labels */
table input[type="text"],
table input[type="email"],
table input[type="tel"],
table input[type="number"],
table input[type="password"],
table textarea,
table select {
    margin-top: 6px;
}

/* Also add margin to inputs inside form tables */
form table input[type="text"],
form table input[type="email"],
form table input[type="tel"],
form table input[type="number"],
form table input[type="password"],
form table textarea,
form table select {
    margin-top: 6px;
}

/* ========================================
   FORM INPUTS (universal for all forms)
   ======================================== */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
    width: 100%;
    min-height: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    padding: 12px 16px;
    font-size: 0.9375rem;
    color: #333;
    box-shadow: none;
    box-sizing: border-box;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
    font-family: 'Open Sans', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Textareas */
textarea {
    min-height: 130px;
    height: auto;
    resize: vertical;
    line-height: 1.5;
}

/* Focus states */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: #FDC403;
    outline: none;
    box-shadow: 0 0 0 3px rgba(253, 196, 3, 0.15);
}

/* Placeholders */
input::placeholder,
textarea::placeholder {
    color: #999;
}

/* Select dropdowns */
select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

/* ========================================
   SYSTEM BARS (from $ost->getError/Warning/Notice)
   ======================================== */
.error_bar {
    margin: 0 0 10px;
    padding: 12px 16px;
    height: auto;
    line-height: 1.4;
    border: 1px solid #e8b4b4;
    border-left: 4px solid #c0392b;
    border-radius: 8px;
    background: #fdf2f2;
    color: #7a2020;
    font-size: 0.875rem;
}

.warning_bar {
    margin: 0 0 10px;
    padding: 12px 16px;
    height: auto;
    line-height: 1.4;
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.875rem;
}

.notice_bar {
    margin: 0 0 10px;
    padding: 12px 16px;
    height: auto;
    line-height: 1.4;
    border: 1px solid #fde68a;
    border-left: 4px solid #fdc403;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.875rem;
}

/* Ticket reopen warning (view.inc.php) */
.warning-banner {
    padding: 12px 16px;
    line-height: 1.4;
    border: 1px solid #fde68a;
    border-left: 4px solid #fdc403;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.875rem;
    margin: 1rem 0;
}

/* ========================================
   ERROR DISPLAY IN FORMS
   ======================================== */
span.error,
font.error,
.error {
    display: inline-block;
    color: #7a2020;
    font-size: 0.8125rem;
    margin-top: 8px;
    font-weight: 500;
}

/* ========================================
   BUTTONS
   ======================================== */

/* Primary button (yellow) */
input[type="submit"],
button[type="submit"],
input.modern-btn,
button.modern-btn,
.modern-btn {
    width: 100%;
    height: 52px;
    background: #FDC403;
    color: #000 !important;
    border: none;
    border-radius: 8px;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(253, 196, 3, 0.3);
    transition: all 0.3s ease;
    margin-top: 16px;
}

input[type="submit"]:hover,
button[type="submit"]:hover,
input.modern-btn:hover,
button.modern-btn:hover,
.modern-btn:hover {
    background: linear-gradient(180deg, #FDC403 0%, #e5b000 100%);
    transform: translateY(-1px);
}

/* Secondary button (for modern-btn-secondary class only) */
button.modern-btn-secondary,
.modern-btn-secondary {
    width: 100%;
    height: 48px;
    background: #fff;
    color: #555;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

button.modern-btn-secondary:hover,
.modern-btn-secondary:hover {
    background: #f8f8f8;
    border-color: #bbb;
}

/* Button container */
.buttons,
p.buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid #f0f0f0;
}

/* Action buttons (Print, Edit - used in view.inc.php) */
.action-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: #eee;
    border-color: #ccc;
    text-decoration: none;
}

/* ========================================
   LOGIN PAGE COMPONENTS
   ======================================== */
.form-side {
    max-width: 500px;
    display: flex;
    flex-direction: column;
}

.form-header {
    margin-bottom: 30px;
}

.form-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 8px 0;
    border: none;
}

.form-header .accent {
    width: 45px;
    height: 4px;
    background: #FDC403;
    border-radius: 2px;
    margin: 12px 0 16px;
}

.form-header .subtitle {
    font-size: 0.9375rem;
    color: #555;
    line-height: 1.6;
}

.input-group {
    margin-bottom: 24px;
    width: 100%;
}

.input-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #000;
    font-size: 0.875rem;
}

.forgot-link,
.helper-text {
    text-align: right;
    margin-top: 8px;
    font-size: 0.8125rem;
}

.forgot-link a,
.helper-text a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-link a:hover,
.helper-text a:hover {
    color: #000;
}

/* ========================================
   RESPONSIVE - HEADER
   ======================================== */
@media (max-width: 768px) {
    .header-container {
        padding: 0 20px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        position: relative;
        flex-wrap: wrap;
        gap: 0;
    }
    
    .header-logo {
        padding: 10px 0;
        order: 1;
        flex: 1;
    }
    
    .mobile-user-icon {
        display: flex;
        order: 2;
        margin-right: 4px;
    }
    
    .mobile-menu-toggle {
        display: block;
        order: 3;
    }
    
    .header-actions {
        position: static;
        width: 100%;
        margin-top: 10px;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        min-width: 0;
        max-width: none;
        display: none;
        z-index: 1000;
        order: 4;
    }
    
    .header-actions.mobile-menu-open {
        display: flex;
    }
    
    .header-actions .guest-info {
        width: 100%;
        justify-content: center;
        margin: 0;
        padding: 14px 20px;
        border-radius: 25px;
        background: #fff;
        border: 1px solid #ddd;
        font-size: 1rem;
        font-weight: 500;
        order: 2;
        box-sizing: border-box;
    }
    
    
    #header .header-actions .btn-signin {
        width: 100%;
        justify-content: center;
        margin: 0;
        padding: 14px 20px;
        border-radius: 25px;
        order: 1;
        box-sizing: border-box;
        font-size: 1rem;
        font-weight: 500;
        line-height: 1.5;
        height: auto;
        min-height: auto;
    }

    #header .header-actions .btn-signin:hover {
        transform: none;
    }
    
    .user-dropdown {
        width: 100%;
    }
    
    .user-menu-trigger {
        display: none;
    }
    
    .header-actions .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .header-actions .dropdown-item {
        padding: 14px 20px;
        border-radius: 25px;
        margin-bottom: 0;
        background: #fff;
        border: 1px solid #ddd;
        font-size: 1rem;
        font-weight: 500;
        text-align: center;
        box-sizing: border-box;
    }
    
    .header-actions .dropdown-item:hover {
        background: #f8f9fa;
        border-color: #ccc;
    }
    
    .header-actions .dropdown-item:last-child {
        margin-bottom: 0;
    }
}

@media (min-width: 769px) {
    .header-actions {
        display: flex;
        opacity: 1;
        visibility: visible;
        position: static;
        flex-direction: row;
    }
}

/* ========================================
   RESPONSIVE - NAVIGATION BAR
   ======================================== */
@media (max-width: 768px) {
    #nav {
        border-radius: 12px;
        padding: 8px;
        margin: 20px;
        max-width: none;
        flex-direction: column;
        gap: 4px;
    }
    
    #nav li {
        display: block;
        width: 100%;
    }
    
    #nav li a {
        padding: 14px 20px;
        border-radius: 8px;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
    
    #nav li a:hover,
    #nav li a.active {
        background: #FDC403;
        color: #000;
    }
}

/* ========================================
   RESPONSIVE - GENERAL
   ======================================== */
@media (max-width: 768px) {
    #content > h1 {
        font-size: 1.625rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
}


/* ========================================
   RESET AND CANCEL BUTTON STYLING
   ======================================== */
input[type="reset"],
#cancel-btn {
    background: transparent;
    color: #999;
    border: none;
    outline: none;
    box-shadow: none;
}

input[type="reset"]:hover,
#cancel-btn:hover {
    background: transparent;
    color: #555;
    border: none;
}

/* ========================================
   FORM BUTTON CONTAINER (Profile & Register)
   ======================================== */
.form-actions {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 35px;
    padding-top: 25px;
}

.form-actions input {
    width: auto;
    padding: 12px 32px;
    font-size: 0.9375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.form-actions input[type="reset"] {
    margin-right: auto;
    margin-top: 0;
    margin-bottom: 0;
}

.form-actions input[type="button"],
.form-actions input[type="submit"] {
    margin-top: 0;
    margin-bottom: 0;
}

/* ========================================
   PHONE + EXT SIDE BY SIDE LAYOUT
   (Used in: open, register, profile)
   ======================================== */
.phone-ext-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.phone-ext-row input[type="tel"] {
    flex: 0 0 70%;
    width: 70%;
    min-width: 0;
}

.phone-ext-row .ext_container {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.phone-ext-row .ext_container input {
    flex: 1;
    min-width: 0;
    width: auto;
}

.phone-ext-row .ext_container span {
    font-weight: 600;
    color: #666;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* ========================================
   TIMEZONE DROPDOWN STYLING
   (Used in: register, profile)
   ======================================== */
#timezone-dropdown + span {
    display: none !important; /* Hide "System Default" text */
}

#timezone-dropdown + span + button {
    margin-top: 12px;
    display: inline-block;
    background: #fff;
    color: #666;
    border: 1px solid #d0d0d0;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#timezone-dropdown + span + button:hover {
    color: #000;
    background: #f8f8f8;
    border-color: #bbb;
}

/* ========================================
   RESPONSIVE - PHONE + EXT
   ======================================== */
@media (max-width: 768px) {
    /* Stack phone and ext on mobile */
    .phone-ext-row {
        flex-wrap: wrap;
    }
    
    .phone-ext-row input[type="tel"] {
        flex: 0 0 100%;
        width: 100%;
    }
    
    .phone-ext-row .ext_container {
        flex: 0 0 100%;
        width: 100%;
        margin-top: 0.5rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .phone-ext-row .ext_container span {
        margin-bottom: 0;
        display: block;
        font-weight: 600;
        font-size: 0.875rem;
    }
    
    .phone-ext-row .ext_container input {
        width: 100%;
        flex: 1;
    }
}

/* ========================================
   UTILITY
   ======================================== */
.clear {
    clear: both;
}

/* =========================
   LOGIN PAGE (login.php)
   ========================= */

body.page-login {
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
}

body.page-login #nav {
    display: none !important;
}

body.page-login #content > #msg_error,
body.page-login #content > #msg_notice,
body.page-login #content > #msg_warning {
    display: none !important;
}

body.page-login #container,
body.page-login #content,
body.page-login #wrapper {
    width: 100% !important;
    max-width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

body.page-login #header .header-actions {
    display: none !important;
}

body.page-login .login-page {
    box-sizing: border-box;
    padding: 20px 50px;
    display: flex;
    flex-direction: column;
}

body.page-login .split-layout {
    display: flex;
    flex-direction: row;
    width: 100%;
    box-sizing: border-box;
    align-items: flex-start;
    justify-content: center;
    gap: 100px;
    margin-bottom: 40px;
}

body.page-login .card-side {
    flex: 0 0 58%;
    max-width: 720px;
    height: 700px;
    background: linear-gradient(180deg, #FDC403 0%, #F5B800 100%);
    border-radius: 70px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 60px;
    overflow: hidden;
}

body.page-login .card-side p {
    margin: 0;
    font-size: 1rem;
    color: #000;
    z-index: 10;
    font-weight: 400;
    letter-spacing: -0.05rem;
}

body.page-login .card-side h2 {
    margin: 4px 0 0 0;
    font-size: 2rem;
    font-weight: 700;
    color: #000;
    border: none;
    z-index: 10;
    letter-spacing: -0.05rem;
}

body.page-login .illustration-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 1;
}

body.page-login .illustration-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

body.page-login .form-side {
    flex: 0 0 38%;
    padding-top: 30px;
}

body.page-login .agent-link {
    margin-top: 35px;
    font-size: 0.875rem;
    color: #888;
}

body.page-login .agent-link a {
    color: #333;
    text-decoration: underline;
    font-weight: 600;
}

@media (max-width: 1200px) {
    body.page-login .split-layout {
        gap: 60px;
    }
    body.page-login .card-side {
        flex: 0 0 50%;
    }
    body.page-login .form-side {
        flex: 0 0 42%;
    }
}

@media (max-width: 900px) {
    body.page-login .login-page {
        padding: 20px;
    }
    body.page-login .split-layout {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    body.page-login .card-side {
        flex: none;
        width: 100%;
        max-width: 100%;
        height: 200px;
        padding-top: 40px;
    }
    body.page-login .illustration-wrapper {
        display: none;
    }
    body.page-login .form-side {
        flex: none;
        width: 100%;
        max-width: 100%;
        padding: 0 20px;
    }
}

@media (max-width: 600px) {
    body.page-login .card-side {
        height: 150px;
        border-radius: 24px;
        padding-top: 30px;
    }
    body.page-login .card-side h2 {
        font-size: 1.5rem;
    }
    body.page-login .card-side p {
        font-size: 0.875rem;
    }
}

/* ========================================
   HOME PAGE (index.php / page-home)
   ======================================== */

body.page-home #container,
body.page-home #content,
body.page-home #wrapper,
body.page-home #landing_page {
    width: 100%;
    max-width: 100%;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    background: transparent;
    overflow-x: hidden;
}

body.page-home #landing_page > .main-content,
body.page-home #landing_page > .knowledge-base-articles-wrapper,
body.page-home #landing_page > .clear {
    display: none;
}

body.page-home .sidebar.main-container,
body.page-home .sidebar.main-container .front-page-button,
body.page-home .sidebar.main-container .content {
    display: none;
}

.custom-home-page {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.hero-section {
    background: linear-gradient(180deg, #FDC403 0%, #F5B800 100%);
    padding: 40px 0 65px 0;
    position: relative;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
}

.wave-separator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.wave-separator svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.wave-separator .shape-fill {
    fill: #ffffff;
}

.hero-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
    gap: 60px;
    padding: 0 140px;
}

.hero-content {
    flex: 1;
    max-width: 650px;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 40px 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
    border: none;
}

.hero-content p {
    font-size: 1.2rem;
    color: #000;
    line-height: 1.5;
    margin: 0;
    font-weight: 400;
}

.hero-icons {
    flex: 0 0 auto;
    width: 550px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-icons img {
    width: 100%;
    height: auto;
    display: block;
}

.action-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(450px, 600px));
    gap: 60px;
    max-width: 1400px;
    width: 100%;
    margin: 40px auto 60px;
    padding: 0 50px;
    box-sizing: border-box;
    justify-content: center;
}

.action-card {
    background: #fff;
    border: 2px solid #000;
    border-radius: 16px;
    padding: 40px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: #FDC403;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.card-icon img {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
    object-fit: contain;
    filter: brightness(0);
}

.action-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    margin: 0 0 10px 0;
    border: none;
}

.action-card p {
    font-size: 15px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 1400px) {
    .hero-content-wrapper {
        padding: 0 80px;
        gap: 40px;
    }

    .hero-content h1 { font-size: 3.5rem; }
    .hero-content p { font-size: 1.1rem; }
    .hero-icons { width: 400px; max-width: 400px; }
}

@media (max-width: 1200px) {
    .hero-content-wrapper {
        padding: 0 60px;
        gap: 30px;
    }

    .hero-content h1 { font-size: 3rem; }
    .hero-content p { font-size: 1rem; }
    .hero-icons { width: 350px; max-width: 350px; }
}

@media (max-width: 1024px) {
    .hero-section { padding: 40px 0 80px 0; }
    .hero-icons { display: none; }

    .hero-content-wrapper {
        justify-content: center;
        text-align: center;
        padding: 0 40px;
    }

    .hero-content { max-width: 100%; }
    .hero-content h1 { font-size: 3rem; }
    .hero-content p { font-size: 1.1rem; }

    .action-cards {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 0 40px;
    }

    .action-card { max-width: 650px; }
}

@media (max-width: 768px) {
    .hero-section { padding: 20px 0 60px 0; }
    .hero-content-wrapper { padding: 0 30px; }
    .hero-content h1 { font-size: 2rem; }

    .action-cards {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 30px;
        margin: 40px 0 60px;
    }

    .action-card { max-width: none; }
    .card-icon { display: flex; }
    .card-icon img { display: block; visibility: visible; }
}

/* =========================
   PASSWORD RESET PAGES
   ========================= */

body.page-pwreset #content {
    max-width: 600px;
    margin: 50px auto;
    padding: 0 20px;
}

body.page-pwreset #clientLogin {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 40px 45px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 30px;
}

body.page-pwreset #clientLogin strong {
    display: none;
}

body.page-pwreset #clientLogin label {
    display: block;
    font-weight: 600;
    color: #222;
    font-size: 0.875rem;
}

body.page-pwreset #clientLogin p {
    margin-top: 30px;
    margin-bottom: 0;
}

.reset-confirmation {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 40px 45px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 30px;
    font-size: 0.875rem;
    color: #444;
    line-height: 1.7;
}

.back-link {
    text-align: center;
    margin-top: 25px;
    font-size: 0.875rem;
    color: #666;
}

.back-link a {
    color: #000;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.back-link a:hover {
    color: #FDC403;
}

@media (max-width: 768px) {
    body.page-pwreset #content {
        margin: 30px auto;
        padding: 0 15px;
    }

    body.page-pwreset #clientLogin {
        padding: 25px 20px;
        border-radius: 12px;
    }

    .reset-confirmation {
        padding: 25px 20px;
        border-radius: 12px;
    }
}

/* =========================
   OPEN TICKET PAGE
   ========================= */

body.page-open #content {
    max-width: 1000px;
    margin: 50px auto;
    padding: 0 20px;
}

body.page-open #ticketForm {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 40px 45px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* Two-column layout */
body.page-open .two-column-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    margin-bottom: 30px;
    position: relative;
}

body.page-open .two-column-container::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #f0f0f0;
    transform: translateX(-50%);
}

body.page-open .left-column,
body.page-open .right-column {
    min-width: 0;
}

body.page-open .column-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 6px 0;
    padding: 0 0 12px 0;
    border-bottom: 3px solid #FDC403;
    display: inline-block;
    margin-bottom: 25px;
}

body.page-open #dynamic-form .form-header,
body.page-open #dynamic-form h3,
body.page-open #dynamic-form legend {
    display: none;
}

body.page-open .left-column .openticket-table legend,
body.page-open .left-column .openticket-table h3,
body.page-open .left-column .openticket-table .form-header {
    display: none;
}

/* Table structure reset */
body.page-open .openticket-table {
    width: 100%;
    border: none;
    border-collapse: collapse;
}

body.page-open .openticket-table tbody {
    display: block;
}

body.page-open .openticket-table tr {
    display: block;
    margin-bottom: 24px;
}

body.page-open .openticket-table td {
    display: block;
    border: none;
    padding: 0;
}

/* Logged-in user info */
body.page-open .user-info-row {
    margin-bottom: 20px;
    background: transparent;
    border: none;
    padding: 0;
}

body.page-open .user-info-row td:first-child {
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-left: 12px;
    position: relative;
}

body.page-open .user-info-row td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 2px;
    background: #FDC403;
}

body.page-open .user-info-row td:last-child {
    background: transparent;
    padding: 0;
    border: none;
    font-size: 1.0625rem;
    color: #000;
    font-weight: 600;
    line-height: 1.4;
}

/* Captcha */
body.page-open #ticketForm .captchaRow {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
}

body.page-open #ticketForm .captchaRow td {
    display: block;
}

body.page-open #ticketForm .captchaRow input[type="text"] {
    max-width: 150px;
}

body.page-open #ticketForm .captchaRow em {
    display: block;
    color: #666;
    font-size: 0.8125rem;
    font-style: normal;
    margin-top: 8px;
}

/* Form actions */
body.page-open .form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #f0f0f0;
}

body.page-open .btn-submit {
    background: #FDC403;
    color: #000;
    border: none;
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(253, 196, 3, 0.3);
    transition: all 0.3s ease;
    height: auto;
    width: auto;
    margin: 0;
}

body.page-open .btn-submit:hover {
    background: linear-gradient(180deg, #FDC403 0%, #e5b000 100%);
    transform: translateY(-1px);
}

/* Confirmation page (overrides general #content above) */
body.page-open #content:not(:has(#ticketForm)) {
    max-width: 700px;
    margin: 50px auto;
    padding: 40px 45px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    font-size: 0.9375rem;
    color: #444;
    line-height: 1.7;
}

@media (max-width: 768px) {
    body.page-open #content {
        margin: 30px auto;
        padding: 0 15px;
    }

    body.page-open #ticketForm {
        padding: 25px 20px;
        border-radius: 12px;
    }

    body.page-open .two-column-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    body.page-open .two-column-container::before {
        display: none;
    }

    body.page-open .column-header {
        font-size: 1.125rem;
    }

    body.page-open .form-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }

    body.page-open .btn-cancel,
    body.page-open .btn-submit {
        width: 100%;
    }

    body.page-open #content:not(:has(#ticketForm)) {
        margin: 30px auto;
        padding: 25px 20px;
        border-radius: 12px;
    }
}

/* =========================
   CHECK TICKET STATUS (accesslink.inc.php)
   ========================= */

body.page-view:has(#clientLogin) #content,
body.page-login:has(#clientLogin) #content {
    max-width: 600px;
    margin: 50px auto;
    padding: 0 20px;
}

body.page-view #clientLogin,
body.page-login .login-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 40px 45px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 30px;
}

body.page-view .login-container,
body.page-view .login-box,
body.page-login .login-container,
body.page-login .login-box {
    width: 100%;
}

body.page-pwreset .form-field,
body.page-view .form-field,
body.page-login .form-field {
    margin-bottom: 30px;
}

body.page-pwreset .form-field input,
body.page-view .form-field input,
body.page-login .form-field input {
    margin-top: 12px;
}

body.page-view .error-container,
body.page-login .error-container {
    margin-bottom: 0;
}

body.page-view .error-container strong:empty,
body.page-login .error-container strong:empty {
    display: none;
}

body.page-view .error-container strong:not(:empty),
body.page-login .error-container strong:not(:empty) {
    display: block;
    color: #7a2020;
    background: #fdf2f2;
    border: 1px solid #e8b4b4;
    border-left: 4px solid #c0392b;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    font-weight: normal;
}

body.page-view #clientLogin label,
body.page-login #clientLogin label {
    display: block;
    font-weight: 600;
    color: #222;
    font-size: 0.875rem;
}

body.page-view #clientLogin p,
body.page-login #clientLogin p {
    margin-top: 30px;
    margin-bottom: 0;
}

body.page-view .instructions,
body.page-login .instructions {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.875rem;
    color: #666;
}

body.page-view .instructions a,
body.page-login .instructions a {
    color: #000;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: color 0.3s ease;
}

body.page-view .instructions a:hover,
body.page-login .instructions a:hover {
    color: #FDC403;
    text-decoration: none;
}

body.page-view #bottom-help-text,
body.page-login #bottom-help-text {
    text-align: center;
    font-size: 0.8125rem;
    color: #666;
    margin-top: 30px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

body.page-view #bottom-help-text::before,
body.page-view #bottom-help-text::after,
body.page-login #bottom-help-text::before,
body.page-login #bottom-help-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #f0f0f0;
    max-width: 150px;
}

body.page-view #bottom-help-text a,
body.page-login #bottom-help-text a {
    color: #000;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

body.page-view #bottom-help-text a:hover,
body.page-login #bottom-help-text a:hover {
    color: #FDC403;
    text-decoration: none;
}

@media (max-width: 768px) {
    body.page-view:has(#clientLogin) #content,
    body.page-login:has(#clientLogin) #content {
        margin: 30px auto;
        padding: 0 15px;
    }

    body.page-view #clientLogin,
    body.page-login .login-box {
        padding: 25px 20px;
        border-radius: 12px;
    }
}

/* =========================
   REGISTER & PROFILE PAGES (account.php / profile.php)
   ========================= */

body.page-account #content,
body.page-profile #content {
    max-width: none;
    margin: 30px auto;
    padding: 0 40px;
}

body.page-account #content > form,
body.page-profile #content > form {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    margin-top: 30px;
}

/* Three-column layout */
body.page-account .register-columns-container,
.profile-columns-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
    position: relative;
}

body.page-account .register-columns-container::before,
body.page-account .register-columns-container::after,
.profile-columns-container::before,
.profile-columns-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #f0f0f0;
}

body.page-account .register-columns-container::before,
.profile-columns-container::before {
    left: 33.33%;
}

body.page-account .register-columns-container::after,
.profile-columns-container::after {
    left: 66.66%;
}

body.page-account .register-column,
.profile-column {
    min-width: 0;
}

body.page-account .register-column-header,
.profile-column-header {
    font-size: 1.125rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 6px 0;
    padding: 0 0 12px 0;
    border-bottom: 3px solid #FDC403;
    display: inline-block;
    margin-bottom: 25px;
}

body.page-account .register-section-header,
.profile-section-header {
    font-size: 1.125rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 25px 0;
    padding: 0 0 12px 0;
    border: none;
    border-bottom: 3px solid #FDC403;
    display: inline-block;
    background: none;
    width: auto;
}

body.page-account .register-column:first-child .form-header,
body.page-account .register-column:first-child .section-break,
body.page-account .register-column:first-child legend,
.profile-column:first-child .form-header,
.profile-column:first-child .section-break,
.profile-column:first-child legend {
    display: none;
}

/* Form rows */
body.page-account .register-settings tr,
.profile-settings tr {
    display: block;
    margin-bottom: 24px;
}

body.page-account .register-settings td,
.profile-settings td {
    display: block;
    border: none;
    padding: 0;
}

body.page-account .register-settings td[width="180"],
.profile-settings td[width="180"] {
    font-weight: 600;
    color: #222;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

body.page-account .register-settings .error,
body.page-account .register-settings span.error,
.profile-settings .error,
.profile-settings span.error {
    display: block;
    color: #7a2020;
    font-size: 0.8125rem;
    margin-top: 6px;
    font-weight: 500;
}

body.page-account .register-settings span.error:empty,
.profile-settings span.error:empty {
    display: none;
}

.profile-settings select[name="timezone"] {
    width: 100%;
}

body.page-account .register-settings input[type="password"],
.profile-settings input[type="password"] {
    width: 100%;
    max-width: 400px;
}

@media (max-width: 1024px) {
    body.page-account .register-columns-container,
    .profile-columns-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    body.page-account .register-columns-container::before,
    body.page-account .register-columns-container::after,
    .profile-columns-container::before,
    .profile-columns-container::after {
        display: none;
    }
}

@media (max-width: 768px) {
    body.page-account #content,
    body.page-profile #content {
        margin: 20px auto;
        padding: 0 15px;
    }

    body.page-account #content > form,
    body.page-profile #content > form {
        padding: 25px 20px;
        border-radius: 12px;
    }

    body.page-account .register-settings h3,
    .profile-settings h3 {
        font-size: 1.125rem;
    }

    body.page-account .register-settings input[type="password"],
    .profile-settings input[type="password"] {
        max-width: 100%;
    }
}

/* =========================
   EDIT TICKET PAGE (tickets.php?a=edit)
   ========================= */

body.page-tickets:has(#edit-ticket-form) #content {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 40px;
}

body.page-tickets:has(#edit-ticket-form) #content > h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 8px 0;
}

body.page-tickets:has(#edit-ticket-form) #content > h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #FDC403;
    border-radius: 2px;
    margin: 16px 0 32px 0;
}

body.page-tickets #edit-ticket-form {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

body.page-tickets #edit-ticket-form h3,
body.page-tickets #edit-ticket-form .form-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #000;
    margin: 0 0 20px 0;
    padding: 0 0 12px 0;
    border-bottom: 3px solid #FDC403;
    display: inline-block;
}

body.page-tickets #edit-ticket-form table {
    width: 100%;
    border: none;
}

body.page-tickets #edit-ticket-form table tbody {
    display: block;
}

body.page-tickets #edit-ticket-form table tr {
    display: block;
    margin-bottom: 24px;
}

body.page-tickets #edit-ticket-form table td {
    display: block;
    border: none;
    padding: 0;
}

body.page-tickets #edit-ticket-form label {
    display: block;
    font-weight: 600;
    color: #000;
    font-size: 0.875rem;
    margin-bottom: 10px;
}

body.page-tickets .edit-form-actions {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #f0f0f0;
}

body.page-tickets .edit-form-actions input[type="submit"],
body.page-tickets .edit-form-actions input[type="button"] {
    width: auto;
    padding: 12px 32px;
    font-size: 0.9375rem;
    margin: 0;
}

body.page-tickets .edit-form-actions input[type="reset"] {
    width: auto;
    padding: 12px 32px;
    font-size: 0.9375rem;
    margin: 0;
    margin-right: auto;
}

body.page-tickets #edit-ticket-form hr {
    display: none;
}

@media (max-width: 768px) {
    body.page-tickets:has(#edit-ticket-form) #content {
        padding: 0 20px;
    }

    body.page-tickets #edit-ticket-form {
        padding: 24px 20px;
        border-radius: 12px;
    }

    body.page-tickets .edit-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    body.page-tickets .edit-form-actions input[type="reset"] {
        margin-right: 0;
        order: 3;
    }

    body.page-tickets .edit-form-actions input[type="button"] {
        order: 2;
    }

    body.page-tickets .edit-form-actions input[type="submit"] {
        order: 1;
    }

    body.page-tickets .edit-form-actions input {
        width: 100%;
    }
}

/* =========================
   VIEW TICKET PAGE (tickets.php?id=X)
   ========================= */

body.page-tickets:has(#ticketInfo) #content {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 40px;
}

/* Header */
body.page-tickets .ticket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 24px;
    margin-bottom: 40px;
    border-bottom: 2px solid #f0f0f0;
    flex-wrap: wrap;
}

body.page-tickets .ticket-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

body.page-tickets #ticketInfo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #000;
    margin: 0;
    padding: 0;
    border: none;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

body.page-tickets #ticketInfo h1 small { color: #999; font-weight: 400; font-size: 1.375rem; }
body.page-tickets #ticketInfo h1 .refresh { color: #999; font-size: 1.25rem; transition: color 0.3s ease; }
body.page-tickets #ticketInfo h1 a:hover .refresh { color: #FDC403; }

/* Info grid */
body.page-tickets .ticket-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

body.page-tickets .infoTable {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.02);
    width: 100%;
    overflow: hidden;
}

body.page-tickets .infoTable thead td.headline,
body.page-tickets .custom-data td.headline {
    background: linear-gradient(to right, rgba(253,196,3,0.05) 0%, rgba(255,255,255,0) 100%);
    border-left: 4px solid #FDC403;
    padding: 16px 24px;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #333;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

body.page-tickets .infoTable th,
body.page-tickets .custom-data th {
    font-weight: 600;
    color: #666;
    font-size: 0.8125rem;
    padding: 16px 24px;
    background: #fff;
    text-align: left;
    vertical-align: top;
}

body.page-tickets .infoTable td,
body.page-tickets .custom-data td {
    color: #333;
    font-size: 0.875rem;
    padding: 16px 24px;
    vertical-align: top;
    font-weight: 500;
}

body.page-tickets .status-indicator { display: inline-flex; align-items: center; gap: 8px; }
body.page-tickets .status-indicator::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #FDC403; }

body.page-tickets .custom-data {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.02);
    overflow: hidden;
}

body.page-tickets .custom-data tbody tr,
body.page-tickets .infoTable tbody tr { border-bottom: 1px solid #f8f8f8; }

body.page-tickets .custom-data tbody tr:last-child,
body.page-tickets .infoTable tbody tr:last-child { border-bottom: none; }

/* Thread */
body.page-tickets #ticketThread { margin-top: 40px; }

body.page-tickets .thread-entry .avatar,
body.page-tickets .thread-entry > .avatar,
body.page-tickets .thread-entry span.avatar,
body.page-tickets .thread-entry img.avatar,
body.page-tickets .thread-entry .pull-left.avatar,
body.page-tickets .thread-entry .pull-right.avatar,
body.page-tickets .thread-event .avatar,
body.page-tickets .thread-event img.avatar,
body.page-tickets span.avatar {
    display: none;
}

body.page-tickets .thread-entry.message,
body.page-tickets .thread-entry.response {
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    overflow: hidden;
    position: relative;
    border: 1px solid #e8e8e8;
    background: #fff;
    display: block;
}

body.page-tickets .thread-entry.message .header {
    background: #FFFBF2;
    border-left: 4px solid #FFC107;
}

body.page-tickets .thread-entry.response .header {
    background: #f8f9fa;
    border-left: 4px solid #d1d5db;
}

body.page-tickets .thread-entry .header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 0.8125rem;
    color: #999;
    min-height: 40px;
}

body.page-tickets .thread-entry .header .pull-right {
    order: 99;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    visibility: visible;
    opacity: 1;
    float: none;
    width: auto;
}

body.page-tickets .thread-entry .header b,
body.page-tickets .thread-event b,
body.page-tickets .thread-entry.system b {
    font-size: 0.875rem;
    color: #111827;
    font-weight: 500;
}

body.page-tickets .thread-entry .header time {
    color: #9CA3AF;
    font-size: 0.8125rem;
    font-weight: 400;
}

body.page-tickets .thread-entry .header a { text-decoration: none; color: inherit; }
body.page-tickets .thread-entry .faded.title { display: none; }

body.page-tickets .thread-entry .thread-body {
    padding: 32px;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #4b5563;
}

body.page-tickets .thread-entry.system,
body.page-tickets .thread-event {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 10px 0;
    margin: 20px 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.75rem;
}

body.page-tickets .thread-entry.system .header,
body.page-tickets .thread-event .header,
body.page-tickets .thread-event {
    background: transparent;
    border: none;
    padding: 0 20px;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    width: auto;
    flex: 0 1 auto;
}

body.page-tickets .thread-entry.system::before,
body.page-tickets .thread-entry.system::after,
body.page-tickets .thread-event::before,
body.page-tickets .thread-event::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0,0,0,0.02);
    height: 1px;
}

body.page-tickets .thread-entry.system .thread-body { display: none; }
body.page-tickets .thread-event .description { display: inline-block; }

body.page-tickets .thread-entry .attachments { padding: 0 32px 24px 32px; }
body.page-tickets .thread-entry .attachment-info {
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 6px 12px;
    border-radius: 6px;
    margin-right: 10px;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Reply form */
body.page-tickets #reply {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 30px;
    margin-top: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

body.page-tickets #reply h2 {
    font-size: 1.25rem;
    border-bottom: 3px solid #FDC403;
    padding-bottom: 10px;
    display: inline-block;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    body.page-tickets .ticket-info-grid { grid-template-columns: 1fr; gap: 20px; }
    body.page-tickets .ticket-header { flex-direction: column; align-items: flex-start; }
    body.page-tickets .ticket-actions { width: 100%; }
    body.page-tickets .action-button { flex: 1; justify-content: center; }

    body.page-tickets .thread-entry .header { flex-wrap: wrap; }
    body.page-tickets .thread-entry .header .pull-right {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
        border-top: 1px solid #eee;
        padding-top: 10px;
        order: 99;
    }
}

/* =========================
   MY TICKETS LIST (tickets.php)
   ========================= */

body.page-tickets:has(#ticketTable) #content {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Search / filter */
body.page-tickets .search.well {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 25px 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 30px;
    margin-top: 0;
}

body.page-tickets .search.well .flush-left {
    width: 100%;
}

body.page-tickets #ticketSearchForm {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

body.page-tickets .search.well input[type="text"],
body.page-tickets #ticketSearchForm input[type="text"] {
    flex: 1;
    min-width: 250px;
    height: 44px;
    line-height: 44px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: none;
    vertical-align: middle;
    margin: 0;
}

body.page-tickets .search.well input[type="text"]:focus,
body.page-tickets #ticketSearchForm input[type="text"]:focus {
    border-color: #FDC403;
    outline: none;
    box-shadow: 0 0 0 3px rgba(253,196,3,0.1);
}

body.page-tickets .search.well input[type="submit"],
body.page-tickets #ticketSearchForm input[type="submit"] {
    width: auto;
    height: 44px;
    line-height: 44px;
    padding: 0 32px;
    background: #FDC403;
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(253,196,3,0.2);
    vertical-align: middle;
    margin: 0;
}

body.page-tickets .search.well input[type="submit"]:hover,
body.page-tickets #ticketSearchForm input[type="submit"]:hover {
    background: #e8b103;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(253,196,3,0.3);
}

body.page-tickets #ticketSearchForm .pull-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: #666;
    font-size: 0.875rem;
    font-weight: 500;
}

body.page-tickets .search.well select,
body.page-tickets #ticketSearchForm select {
    width: auto;
    min-width: 200px;
    height: 44px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 0.875rem;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.page-tickets .search.well select:hover,
body.page-tickets #ticketSearchForm select:hover {
    border-color: #d0d0d0;
}

body.page-tickets .search.well select:focus,
body.page-tickets #ticketSearchForm select:focus {
    border-color: #FDC403;
    outline: none;
    box-shadow: 0 0 0 3px rgba(253,196,3,0.1);
}

body.page-tickets .search.well > div > div {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

body.page-tickets .search.well a[href="?clear"] {
    color: #666;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

body.page-tickets .search.well a[href="?clear"]:hover {
    color: #000;
}

/* Page title with state filters */
body.page-tickets:has(#ticketTable) #content > h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #000;
    margin: 30px 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

body.page-tickets:has(#ticketTable) #content > h1::after {
    display: none;
}

body.page-tickets:has(#ticketTable) #content > h1 a {
    color: #000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.page-tickets:has(#ticketTable) #content > h1 .refresh {
    color: #666;
    font-size: 1.25rem;
    transition: color 0.3s ease;
}

body.page-tickets:has(#ticketTable) #content > h1 a:hover .refresh {
    color: #FDC403;
}

body.page-tickets .states {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.page-tickets .states a.state {
    color: #666;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

body.page-tickets .states a.state:hover {
    background: #f5f5f5;
    color: #000;
}

body.page-tickets .states a.state.active {
    background: #FDC403;
    color: #000;
    font-weight: 600;
}

/* Tickets table */
body.page-tickets .table-wrapper {
    background: #fff;
    border-radius: 32px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 20px 60px rgba(0,0,0,0.02);
    overflow: hidden;
}

body.page-tickets #ticketTable {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    border: none;
    margin-bottom: 0;
}

body.page-tickets #ticketTable caption {
    background: linear-gradient(to right, rgba(253,196,3,0.05) 0%, rgba(255,255,255,0) 100%);
    border-left: 6px solid #FDC403;
    padding: 24px 32px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #666;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

body.page-tickets #ticketTable thead th {
    background: #fff;
    padding: 24px 32px;
    font-weight: 700;
    color: #666;
    font-size: 0.6875rem;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
    border-right: none;
    border-top: none;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    white-space: nowrap;
}

body.page-tickets #ticketTable thead th a {
    color: #666;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
    white-space: nowrap;
}

body.page-tickets #ticketTable thead th a:hover {
    color: #FDC403;
}

body.page-tickets #ticketTable thead th a .icon-sort {
    display: none;
}

body.page-tickets #ticketTable thead th a::after {
    content: '';
    width: 12px;
    height: 12px;
    background-image: url('../images/icons/arrow.svg');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    transition: all 0.2s ease;
    filter: brightness(0) saturate(100%) invert(40%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(92%);
}

body.page-tickets #ticketTable thead th a:hover::after {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(73%) sepia(85%) saturate(1542%) hue-rotate(1deg) brightness(103%) contrast(101%);
}

body.page-tickets #ticketTable tbody tr {
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.3s ease;
    cursor: pointer;
}

body.page-tickets #ticketTable tbody tr:hover {
    background: rgba(250,250,250,0.8);
}

body.page-tickets #ticketTable tbody tr:last-child {
    border-bottom: none;
}

body.page-tickets #ticketTable tbody td {
    padding: 28px 32px;
    border-right: none;
    border-top: none;
    border-bottom: none;
    font-size: 0.875rem;
    color: #333;
    transition: all 0.3s ease;
}

body.page-tickets .ticket-number a {
    color: #666;
    text-decoration: none;
    padding-left: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    transition: color 0.2s ease;
}

body.page-tickets #ticketTable tbody tr:hover .ticket-number a {
    color: #000;
}

body.page-tickets .ticket-number a::before {
    content: '#';
}

body.page-tickets .ticket-date {
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

body.page-tickets #ticketTable tbody td.ticket-status {
    font-size: 0.625rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

body.page-tickets .ticket-subject {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #333;
    line-height: 1.6;
}

body.page-tickets #ticketTable tbody tr:hover .ticket-subject {
    color: #000;
}

body.page-tickets .ticket-subject .truncate {
    max-width: none;
    max-height: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    display: block;
}

body.page-tickets #ticketTable tbody td.ticket-dept {
    font-size: 0.625rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

body.page-tickets #ticketTable tbody tr:hover .ticket-dept {
    color: #333;
}

body.page-tickets #ticketTable .icon-group {
    color: #FDC403;
    margin-right: 8px;
}

/* Status badge */
body.page-tickets .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid;
    transition: all 0.3s ease;
}

body.page-tickets .status-badge.status-open {
    background: rgba(255,193,7,0.05);
    border-color: rgba(255,193,7,0.15);
    color: #FDC403;
}

body.page-tickets .status-badge.status-open img {
    filter: brightness(0) saturate(100%) invert(73%) sepia(85%) saturate(1542%) hue-rotate(1deg) brightness(103%) contrast(101%);
}

body.page-tickets #ticketTable tbody tr:hover .status-badge.status-open {
    background: #FDC403;
    color: #000;
    border-color: #FDC403;
}

body.page-tickets #ticketTable tbody tr:hover .status-badge.status-open img {
    filter: brightness(0) saturate(100%);
}

body.page-tickets .status-badge.status-closed {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.05);
    color: #999;
}

body.page-tickets .status-badge.status-closed img {
    filter: brightness(0) saturate(100%) invert(67%) sepia(0%) saturate(0%) hue-rotate(178deg) brightness(95%) contrast(89%);
}

body.page-tickets .status-badge img {
    width: 12px;
    height: 12px;
    transition: filter 0.3s ease;
}

/* Empty state */
body.page-tickets #ticketTable tbody td[colspan="5"] {
    text-align: center;
    padding: 80px 40px;
    color: #ccc;
    font-style: normal;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* Pagination */
body.page-tickets .pagination {
    text-align: left;
    padding: 20px 0;
    font-size: 0.875rem;
    margin-top: 50px;
}

@media (max-width: 968px) {
    body.page-tickets #ticketSearchForm {
        flex-direction: column;
        align-items: stretch;
    }

    body.page-tickets #ticketSearchForm input[type="text"] {
        width: 100%;
        min-width: 0;
    }

    body.page-tickets #ticketSearchForm input[type="submit"] {
        width: 100%;
    }

    body.page-tickets #ticketSearchForm .pull-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    body.page-tickets #ticketSearchForm select {
        width: 100%;
    }

    body.page-tickets .table-wrapper {
        border-radius: 20px;
    }

    body.page-tickets #ticketTable thead th,
    body.page-tickets #ticketTable tbody td {
        padding: 16px 20px;
    }
}

@media (max-width: 768px) {
    body.page-tickets:has(#ticketTable) #content {
        margin: 20px auto;
        padding: 0 15px;
    }

    body.page-tickets .search.well {
        padding: 20px;
        border-radius: 12px;
    }

    body.page-tickets:has(#ticketTable) #content > h1 {
        font-size: 1.375rem;
        flex-direction: column;
        align-items: flex-start;
    }

    body.page-tickets .states {
        width: 100%;
    }

    body.page-tickets .table-wrapper {
        border-radius: 16px;
    }

    body.page-tickets #ticketTable caption {
        font-size: 0.75rem;
        padding: 16px 20px;
    }
}