.login-page .card {
    max-width: 320px;
    width: 100%;
    margin: 60px auto;
    padding: 30px;
    border-radius: 12px;
    justify-content: center; /* vertical center */
    align-items: center;     /* horizontal center */
    
}
body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: #0d1117;
    color: #e6edf3;
}

/* LAYOUT WRAPPER */
.layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    background: #161b22;
    padding: 20px;
    border-right: 1px solid #21262d;
    flex-shrink: 0;
}
a {
    color: #ff7a00;
    text-decoration: none;
}

a:hover {
    color: #ff7a00;
    text-decoration: none;
}
a:visited {
    color: #ff7a00;
}
a:hover {
    opacity: 0.85;
}
.sidebar h2 {
    color: #ff7a00;
}

.sidebar a {
    display: block;
    color: #c9d1d9;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 5px;
}

.sidebar a:hover {
    background: #21262d;
    color: #ff7a00;
}

/* MAIN CONTENT */
.main {
    flex: 1;
    padding: 40px;
    box-sizing: border-box;
}

/* CARD */
.card {
    background: #161b22;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #2a2f36;

    /* adds separation visually */
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    transition: 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.45);
}
hr {
    border: none;
    height: 1px;
    background: #2a2f3a;
    margin: 12px 0;
}

/* FORM ELEMENTS */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    margin-top: 10px;
    margin-bottom: 10px;

    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;

    box-sizing: border-box;
}
/* Remove number input arrows (Chrome, Edge, Safari) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove arrows (Firefox) */
input[type="number"] {
    -moz-appearance: textfield;
}
button {
    width: 100%;
    height: 36px;
    padding: 12px;
    margin-top: 10px;
    background: #ff7a00;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

button:hover {
    background: #e66a00;
}

/* LOGIN PAGE */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* =========================
   SETTINGS GRID (CLEAN)
========================= */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);

    /* REAL spacing between cards */
    gap: 30px;

    /* spacing from page edges */
    margin-top: 30px;
}

/* Ensure cards behave correctly inside grid */
.settings-grid > .card {
    width: 100%;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}
/* ===== FORCE REAL SPACING FOR SETTINGS ===== */

/* Add outer spacing so cards don't touch edges */
.main {
    padding: 40px 60px !important;
}

/* Grid spacing */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px; /* bigger = visible spacing */
    margin-top: 30px;
}

/* Make sure cards don't stretch weirdly */
.settings-grid > .card {
    width: 100%;
    box-sizing: border-box;
}

/* Ensure visual separation */
.card {
    background: #161b22;
    border: 1px solid #2a2f36;
    border-radius: 12px;
    padding: 25px;

    /* THIS is what makes spacing visible */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Optional: slightly different background behind grid for contrast */
.main {
    background: #0b0f14;
}
/* TABLE STYLE */
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #2a2f36;
    color: #9da5b4;
    font-size: 13px;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #1f242b;
}

/* ROLE BADGES */
.role-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.role-admin {
    background: #6c3df4;
    color: white;
}
.role-super_admin {
    background: linear-gradient(135deg, #ff3b3b, #800000);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.6);
}
.role-user {
    background: #2a2f36;
    color: #ccc;
}

/* ACTION BUTTONS */
table button {
    width: auto;
    padding: 6px 10px;
    font-size: 12px;
    margin-left: 5px;
}
/* ROLE MODAL STYLING */

.role-option input {
    display: none;
}

.role-card {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #2a2f36;
    background: #0d1117;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
}

/* Hover */
.role-card:hover {
    border-color: #ff7a00;
}

/* Checked state */
.role-option input:checked + .role-card {
    border-color: #ff7a00;
    box-shadow: 0 0 0 1px #ff7a00;
}

/* Role colors */
.role-admin {
    color: #fff;
}

.role-user {
    color: #ccc;
}
/* FIX SELECT DROPDOWN */
.styled-select {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    box-sizing: border-box;

    appearance: none;
}

/* Dropdown arrow fix */
.styled-select {
    width: 100%;
    height: 41px; /* FORCE same height as inputs */
    padding: 0 12px; /* remove vertical padding mismatch */
    margin-top: 10px;

    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;

    box-sizing: border-box;
    appearance: none;

    display: flex;
    align-items: center; /* vertical centering */
}

/* PROFILE ROW (FORCED FIX) */
.main .profile-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 12px !important;
    width: 100%;
}

.main .profile-row input {
    width: 100% !important;
    min-width: 0 !important;
    display: block;
}
table th {
    padding: 12px 10px;
    font-weight: 600;
    color: #c9d1d9;
}

table td {
    padding: 12px 10px;
}

/* GENERIC FORM ROWS (REUSABLE SYSTEM) */

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.form-row-2 input,
.form-row-3 input,
.form-row-2 select,
.form-row-3 select {
    width: 100%;
    min-width: 0;
}
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-badge.online {
    background: #1f6f3e;
    color: #4CAF50;
}

.status-badge.offline {
    background: #5a1d1d;
    color: #ff4d4d;
}
.status-badge.unknown {
    background: #2a2f36;
    color: #aaa;
}
/* Card section divider (for titles like Uptime Monitoring / Overview) */
.card h2 {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.card h2::after {
    content: "";
    display: block;
    width: 80px;              /* short line */
    height: 2px;
    background: #2a2f36;      /* subtle grey */
    margin-top: 8px;
    border-radius: 2px;
}
/* ACTIVE SIDEBAR LINK */
.sidebar a.active {
    background: #21262d;
    color: #ff7a00;
}

/* BADGE (ticket count) */
.sidebar .badge {
    float: right;
    background: #ff7a00;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
}
/* FORCE INLINE SEARCH FORM (OVERRIDE GLOBAL CARD FORM) */
.tickets-search-form {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
}

/* KEEP BUTTON NORMAL */
.tickets-search-form button {
    width: auto;
}
/* CLEAN SPACING */
.sidebar a {
    position: relative;
}
.form-row-2.compact {
    gap: 4px;
}

/* ===== CREATE USER BOX ONLY ===== */

.card form {
    display: flex;
    flex-direction: column;
    gap: 8px; /*  controls vertical spacing */
}

/* ROW 1: USERNAME + FIRST + LAST */
.create-row-1 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

/* ROW 2: EMAIL + WHATSAPP */
.create-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* ROW 3: RDP */
.create-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* REDUCE INPUT SPACING INSIDE CREATE ONLY */
.create-row-1 input,
.create-row-2 input,
.create-row-3 input,
.card form > input {
    margin: 0;
    gap: 6px;
}

.clients-table {
    table-layout: fixed;
}

.clients-table tr {
    height: 56px;
}
.form-U-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.clients-table td,
.clients-table th {
    vertical-align: middle;
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
}
/* COLUMN WIDTH CONTROL */
.clients-table {
    table-layout: fixed;
}

/* FIRST NAME */
.clients-table th:nth-child(1),
.clients-table td:nth-child(1) {
    width: 14%;
}

/* LAST NAME */
.clients-table th:nth-child(2),
.clients-table td:nth-child(2) {
    width: 12%;
}

/* EMAIL (WIDER) */
.clients-table th:nth-child(3),
.clients-table td:nth-child(3) {
    width: 22%;
}

/* WHATSAPP */
.clients-table th:nth-child(4),
.clients-table td:nth-child(4) {
    width: 14%;
}

/* ROLE */
.clients-table th:nth-child(5),
.clients-table td:nth-child(5) {
    width: 10%;
}

/* ACTIONS */
.clients-table th:nth-child(6),
.clients-table td:nth-child(6) {
    width: 28%;
}
.compact input {
    margin-bottom: 3px;
}
/* STATUS */
.status-open { background:#2a2f36; color:#ccc; }
.status-pending { background:#5a3d00; color:#ffb84d; }
.status-closed { background:#1f6f3e; color:#4CAF50; }

/* PRIORITY */
.priority-low { background:#2a2f36; color:#aaa; }
.priority-normal { background:#1e3a5f; color:#4da6ff; }
.priority-important { background:#5a3d00; color:#ffb84d; }
.priority-critical { background:#5a1d1d; color:#ff4d4d; }

.badge-pill {
    padding:4px 8px;
    border-radius:20px;
    font-size:12px;
}
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.badge-pill {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
}

/* STATUS */
.status-open { background:#2a2f36; color:#ccc; }
.status-pending { background:#5a3d00; color:#ffb84d; }
.status-closed { background:#1f6f3e; color:#4CAF50; }

/* PRIORITY */
.priority-low { background:#2a2f36; color:#aaa; }
.priority-normal { background:#1e3a5f; color:#4da6ff; }
.priority-important { background:#5a3d00; color:#ffb84d; }
.priority-critical { background:#5a1d1d; color:#ff4d4d; }
/* Fix button inside headers only */
.tickets-header button {
    width: auto !important;
    display: inline-block;
}
.tickets-header {
    display: flex;
    align-items: center;
}

.tickets-header h2 {
    margin: 0;
}

.tickets-header button {
    margin-left: auto;
}
textarea {
    width: 100%;
    padding: 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    resize: none;
    min-height: 140px;
}
/* 2 COLUMN (50/50) */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

/* SUBJECT 60% + WHATSAPP 40% */
.form-row-split {
    display: grid;
    grid-template-columns: 6fr 4fr;
    gap: 12px;
    margin-bottom: 10px;
}

/* EMAIL 60% + PRIORITY 20% + STATUS 20% */
.form-row-3 {
    display: grid;
    grid-template-columns: 6fr 2fr 2fr;
    gap: 12px;
    margin-bottom: 10px;
}

/* FIX TEXTAREA */
textarea {
    width: 100%;
    padding: 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    resize: none;
    height: 140px;
    box-sizing: border-box;
    margin-bottom: 10px;
}
/* SUCCESS NOTIFICATION (MATCH SYSTEM STYLE) */
.notification-success {
    border-left: 4px solid #ff7a00;
    margin-bottom: 25px;
}
.notification-success {
    border-left: 4px solid #ff7a00;
    margin-bottom: 25px;
    padding-left: 15px;
}
.ticket-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

/* LEFT + RIGHT COLUMNS */
.ticket-actions-left,
.ticket-actions-right {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* REMOVE GLOBAL INPUT SPACING INSIDE THIS BLOCK */
.ticket-actions input,
.ticket-actions select,
.ticket-actions textarea,
.ticket-actions button {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
/* CHAT STYLE */
.ticket-bubble {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    max-width: 80%;
}

.ticket-bubble.user {
    background: #0d1117;
    border: 1px solid #30363d;
}

.ticket-bubble.admin {
    background: #161b22;
    border: 1px solid #ff7a00;
    margin-left: auto;
}

/* ACTION GRID */
.ticket-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.ticket-actions-left,
.ticket-actions-right {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* BOTTOM ROW (UPDATE + CLOSE) */
.ticket-actions-bottom {
    grid-column: span 2;
    display: flex;
    gap: 10px;
}

/* FIX GLOBAL SPACING */
.ticket-actions input,
.ticket-actions select,
.ticket-actions textarea,
.ticket-actions button {
    margin: 0 !important;
}
/* HEADER ACTIONS */
.tickets-header-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

/* TOGGLE BUTTON */
.toggle-btn {
    padding: 8px 12px;
    background: #2a2f36;
    border-radius: 6px;
    color: #ccc;
    text-decoration: none;
}

.toggle-btn:hover {
    background: #3a4048;
}

/* SUCCESS NOTIFICATION FIX */
.notification-success {
    border-left: 4px solid #ff7a00;
    margin-bottom: 25px;
}

/* ACTION BUTTONS INLINE */
table form {
    display: inline;
}
/* ===== GLOBAL SCROLLBAR (CHROME, EDGE, SAFARI) ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0d1117; /* same as your background */
}

::-webkit-scrollbar-thumb {
    background: #ff7a00; /* Nexity orange */
    border-radius: 8px;
    border: 2px solid #0d1117; /* creates padding effect */
}

::-webkit-scrollbar-thumb:hover {
    background: #e66a00;
}

/* ===== FIREFOX SUPPORT ===== */
* {
    scrollbar-width: thin;
    scrollbar-color: #ff7a00 #0d1117;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff7a00, #e66a00);
    border-radius: 10px;
}
.ticket-thread {
    flex: 1;
    overflow-y: auto;

    /* spacing from right edge */
    padding-right: 12px;

    /* prevents layout shift when scrollbar appears */
    box-sizing: content-box;
}

/* TOP CONTROLS */
.ticket-top-controls {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.ticket-top-left {
    display: flex;
    gap: 10px;
}

.ticket-top-right button {
    width: auto;
}

/* SPACING */
.ticket-spacing {
    height: 10px;
}

/* BOTTOM ACTIONS */
.ticket-bottom-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.ticket-bottom-actions button {
    width: auto;
}
.ticket-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ticket-field span {
    font-size: 13px;
    color: #9da5b4;
    white-space: nowrap;
}

.ticket-top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-top-left {
    display: flex;
    gap: 15px;
}

.ticket-top-right button {
    width: auto;
}

.ticket-bottom-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.ticket-bottom-actions button {
    width: auto;
}

.ticket-spacing {
    height: 10px;
}
.ticket-update-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    width: 100%;
}

.ticket-update-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* IMPORTANT FIX */
.ticket-update-field .styled-select {
    width: 100%;
}

.ticket-update-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.ticket-update-buttons button {
    flex: 1;
    width: auto; /* overrides global 100% */
}
.ticket-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
}

.ticket-time {
    color: #9da5b4;
}
.unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ff7a00;
    border-radius: 50%;
    margin-left: 6px;
}
.ticket-modal-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* HEADER */
.ticket-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.ticket-modal-header {
    margin-bottom: 25px;
}

.section-title {
    letter-spacing: 0.3px;
}

.ticket-modal-divider {
    height: 3px;              /* thicker */
    width: 120px;             /* shorter */
    background: #3a3f4b;      /* slightly brighter for visibility */
    margin-top: 8px;
    border-radius: 2px;
}

/* GRID LAYOUT */
.ticket-modal-grid {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 20px;
    position: relative;

    align-items: stretch;   /* IMPORTANT */
}

/* LEFT SIDE */
.ticket-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}



.ticket-update-title {
    font-size: 14px;
    font-weight: 600;
    color: #9da5b4;
}


/* FOOTER */
.ticket-modal-footer {
    display: flex;
    justify-content: flex-end;
}

/* KEEP CLOSE BUTTON SIZE */
.btn-close {
    background: #333;
    padding: 8px 16px;        /* match your Update button */
    border-radius: 6px;
    height: 36px;             /* force consistent height */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* SECTION TITLES (mid-level hierarchy) */
.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #c9d1d9;
}



/* Make sure spacing feels right */
.ticket-left,
.ticket-right {
    
}
.btn-secondary {
    background: #2a2f3a;
    color: #c9d1d9;
    height: 36px;
    padding: 0 16px;
    border-radius: 6px;

    display: inline-flex;
    align-items: center;
    justify-content: center;  /* THIS fixes centering */
}
.section-divider {
    border: none;
    height: 2px;              /* match thickness */
    background: #2a2f3a;
    width: 100%;              /* full width of container */
    margin: 8px 0 14px 0;
}
.ticket-modal-grid::after {
    content: "";
    position: absolute;
    top: 65px;              /* starts below section titles */
    height: calc(100% - 140px); /* stops before View Replies */
    left: 68%;              /* shift LEFT to avoid buttons */
    width: 1px;
    background: #2a2f3a;
}
.ticket-field {
    display: grid;
    grid-template-columns: 80px 1fr; /* fixed label width */
    align-items: center;
    gap: 10px;
}

.ticket-field label {
    font-size: 13px;
    color: #9da5b4;
}
.ticket-left {
    padding-right: 38px;  /* prevents overflow illusion */
}
.ticket-right {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 12px;
}
.ticket-right-actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
button {
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ticket-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;   /* CRITICAL */
}
.ticket-thread {
    flex: 1;   /* pushes View Replies to bottom */
    display: flex;
    flex-direction: column;
}
.ticket-user-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.ticket-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.ticket-info-row span {
    color: #9da5b4;
}

.ticket-info-row strong {
    color: #e6edf3;
}
/* FIX TICKET UPDATE FORM ONLY */
.ticket-update-form {
    display: block !important;
}

/* ===================================================================================
   TICKETS PAGE ISOLATION
=================================================================================== */

/* RESET BROKEN GLOBAL FORM BEHAVIOR */
.tickets-page .card form {
    display: block !important;
}

/* SEARCH BAR (INLINE) */
.tickets-page .tickets-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tickets-page .tickets-header-actions form {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
}

/* FIX INPUT + BUTTON HEIGHT */
.tickets-page input,
.tickets-page button {
    height: 36px;
}

/* =========================
   TABLE STABILITY
========================= */

.tickets-page table {
    width: 100%;
    table-layout: auto;
}

.tickets-page tr {
    height: auto;
}

.tickets-page td {
    vertical-align: middle;
    white-space: normal; /* allow wrapping */
}

/* =========================
   ACTION BUTTON FIX
========================= */

.tickets-page .actions-cell {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* FORCE NORMAL BEHAVIOR */
.tickets-page .ticket-update-form {
    display: block !important;
}























html {
    visibility: visible;
}
