/* Base Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Segoe UI", sans-serif; line-height: 1.6; background: var(--bg); color: var(--text); padding: 0; }

/* Theme variables */
:root {
    --bg: #f4f4f4;
    --text: #0c0c0c;
    --card: #fff;
    --btn-bg: #153759;
    --btn-fg: #fff;
    --td-act: #444444;
}
[data-theme="dark"] {
    --bg: #222;
    --text: #eee;
    --card: #333;
    --btn-bg: #7da6d0;
    --btn-fg: #fff;
    --td-act: #fff;
}

.container{
    background: var(--card);
}

/* Layout */
.main-nav,
.footer{
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card);
    padding: 10px 20px;
    border-bottom: 1px solid #ccc;
    flex-wrap: wrap;
}
.main-nav .logo { font-weight: bold; font-size: 1.2rem; }
.nav-links {
    display: flex; list-style: none; gap: 15px;
}
.nav-links li a { text-decoration: none; color: var(--text); padding: 8px 12px; border-radius: 4px; display: flex; align-items: center; }
.nav-links li a:hover, .menu-link.active, .submenu-link.active { background: var(--btn-bg); color: var(--btn-fg); }

/* Icons */
.nav-links .icon { margin-right: 6px; font-size: 1.1rem; }

nav ul li a i,
.submenu li a i,
.breadcrumbs a i,
.breadcrumbs span i {
    margin-right: 6px;
}


/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    background: var(--card);
    border: 1px solid #ccc;
    list-style: none;
    top: 100%; left: 0;
    min-width: 140px;
    z-index: 99;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu li a {
    padding: 8px 10px 8px 25px;
    display: block; }
/* Hamburger */
.hamburger { display: none; background: none; font-size: 1.4rem; border: none; cursor: pointer; color: var(--text) }

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: var(--card);
    font-size: 0.95rem;
    overflow-x: auto;
    white-space: nowrap;
}
.breadcrumbs a { text-decoration: none; color: var(--text); }
.breadcrumbs a:hover { text-decoration: underline; }
.crumb-icon { margin-right: 4px; }
.crumb-separator { color: #999; }
.breadcrumbs .active { color: var(--btn-bg); font-weight: bold; }

/* Top-bar (theme toggle / nav links) */
.top-bar {
    display: flex; align-items: center;
    padding: 10px;
    background: var(--card);
}
.top-bar a { margin-left: 10px; text-decoration: none; color: var(--text); }
.top-bar .spacer { flex: 1; }

/* Content */
header {
    background: var(--bg); color: var(--text); padding: 1rem; text-align: center;
    display: flex;
    align-items: center;
    gap: 5px;
}
main { padding: 20px; }

/* Accordion */
.accordion { margin-bottom: 20px; }
.accordion-toggle {
    background: var(--btn-bg); color: var(--btn-fg); padding: 10px;
    border: none; width: 100%; cursor: pointer; border-radius: 5px;
}
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }

/* Table */
.responsive-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--card);
    border-radius: 5px;
}


table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    font-size: 0.95rem;
}
th, td {
    padding: 5px 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}
th { background: var(--btn-bg); color: var(--btn-fg); }
td button {
    background: #28a745; color: white; border: none;
    padding: 6px 12px; border-radius: 4px; cursor: pointer;
}
td button:hover { background: #218838; }

.responsive-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Forms */
form { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; background: var(--card); padding: 20px 0; border-radius: 5px; }
.form-group { display: flex; flex-direction: column; position: relative; }
label { margin-bottom: 5px; font-weight: bold; }
input, textarea { padding: 10px; border: 1px solid #ccc; border-radius: 4px; }
.full-width { grid-column: 1 / -1; }
button[type="submit"],.btn, .auth-form button { grid-column: 1 / -1; padding: 12px; background-color: var(--btn-bg); color: var(--btn-fg); font-size: 1rem; border: none; border-radius: 5px; cursor: pointer; text-decoration: none }
button[type="submit"]:hover, .btn:hover, .auth-form button:hover { background-color: var(--btn-bg); filter: brightness(0.9); }

button[type="submit"].sm,.btn.sm, .auth-form button.sm{
    padding: 7px 10px;
}

/* Password toggle */
.password-wrapper .toggle-password {
    position: absolute; right: 10px; top: 28px; cursor: pointer; font-size: 1.1rem;
    color: #3f3f3f;
}

/* Auth form layout */
.auth-form {
    max-width: 400px; margin: 40px auto;
}
.auth-form h2 { text-align: center; margin-bottom: 20px; }

/* Profile info */
.profile-info p { margin-bottom: 8px; font-size: 0.95rem; }

.logo img.logo-img {
    height: 70px;
    width: auto;
    display: block;
}

.footer{
    border-bottom: none !important;
    border-top: 1px solid #ccc;
}

.text-right{
    text-align: right !important;
}
.text-left{
    text-align: left !important;
}
.text-center{
    text-align: center !important;
}

form{
    padding-top: 7px;
}

fieldset{
    border: none;
    padding: 0;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    background: var(--card);
    padding: 0 10px 7px;
    border-radius: 5px;
}

.grid-form.small-grid{
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 15px;
    padding: 10px;
}

.grid-form .form-group {
    display: flex;
    flex-direction: column;
    position: relative;
}


.grid-form label {
    margin-bottom: 5px;
    font-weight: bold;
}
.grid-form input,
.grid-form select,
.grid-form textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.grid-form .full-width {
    grid-column: 1 / -1;
}

.grid-form .half-grid {
    grid-column: span 2;       /* default 3-column grid → 66.7% */
}



.grid-form button[type="submit"] {
    grid-column: 1 / -1;
    padding: 12px;
    background-color: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.grid-form button:hover {
    background-color: var(--btn-bg);
    filter: brightness(0.9);
}

.w50{
    width:50px;
}
.w100{
    width: 100px;
}
.w150{
    width: 150px;
}
.w200{
    width: 200px;
}
.grid-form [type='submit'],
.grid-form a{
    margin-top: 22px;
}


td .view_ticket, td .edit_ticket, td .delete_ticket, .delete_ticket {
    color:var(--td-act);
}
tr.click_charge_ticket td .view_ticket,
tr.click_charge_ticket td .edit_ticket,
tr.click_charge_ticket td .delete_ticket{
    color: #0c0c0c;
}

/*
Some changes to the links using images and replace them with icons
 */

td .edit_ticket,
td .delete_ticket,
td .cancel_ticket,
td .view_ticket {
    display: inline-block;
    padding-left: 14px; /* space for icon */
    position: relative;
    font-weight: 500;
    color: inherit;
    text-decoration: none;
    margin-right:6px;
}

td .edit_ticket::before,
td .delete_ticket::before,
td .cancel_ticket::before,
td .view_ticket::before {
    font-family: "Font Awesome 6 Free"; /* FontAwesome */
    font-weight: 900; /* solid icons */
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Individual icons with colors */
td .edit_ticket::before {
    content: "\f044"; /* fa-pen-to-square */
    color: #007bff;   /* blue */
}

td .delete_ticket::before {
    content: "\f1f8"; /* fa-trash */
    color: #dc3545;   /* red */
}

td .cancel_ticket::before {
    content: "\f05e"; /* fa-ban */
    color: #fd7e14;   /* orange */
}

td .view_ticket::before {
    content: "\f06e"; /* fa-eye */
    color: #28a745;   /* green */
}



hr{
    height: 1px;
    border: 1px solid #999;
}

#search{
    display: none;
}

.pagination {
    display: flex;
    justify-content: center;   /* center the links */
    align-items: center;
    gap: 12px;                 /* space between prev/next */
    margin: 20px 0;
}

.pagination a {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    border: 1px solid #ddd;
}

.pagination a:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination a.prev::before {
    content: "« "; /* left arrow */
}

.pagination a.next::after {
    content: " »"; /* right arrow */
}

.pico-content{
    color:#333;
}

.pico-content a.button{
    grid-column: 1 / -1;
    padding: 4px 7px;
    background-color: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 0.85rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger { display: block; }
    .nav-links { flex-direction: column; width: 100%; display: none; gap: 0; margin-top: 10px; }
    .nav-links.show { display: flex; }
    .dropdown:hover .dropdown-menu { display: none; }
    .dropdown.open .dropdown-menu { display: block; position: static; border: none; }
    .grid-form [type='submit'],
    .grid-form a{
        margin-top: 0 !important;
    }
    .grid-form {
        padding: 0 0 10px;
    }

    #search{
        display: block;
    }

    .search_form{
        display:none;
    }

    table, thead, tbody, th, td, tr {
        display: block;
        width: 100%;
    }

    thead {
        display: none; /* hide headers */
    }

    tr {
        margin-bottom: 7px;
        border: 1px solid #939393;
        border-radius: 2px;
        padding: 0;
    }

    td {
        border: none;
        display: block;
        padding: 4px 8px;
        font-size: 0.9rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        margin-bottom: 4px;
    }
}

