/*
|--------------------------------------------------------------------------
| CUSTOMER CSS (1. Variables & Base)
|--------------------------------------------------------------------------
*/
:root {
    --ptc-primary: #0A84FF;
    --ptc-primary-hover: #0066CC;

    --ptc-bg: #F8FAFC;

    --ptc-dark: #0F172A;

    --ptc-text: #334155;

    --ptc-border: #E2E8F0;

    --ptc-white: #FFFFFF;

    --ptc-text-muted: #64748B;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        "Segoe UI",
        Tahoma,
        sans-serif;
    background: var(--ptc-bg);
    color: var(--ptc-text);
}

/* ---------------------------------------------------------------
   2. Customer Layout
   ------------------------------------------------------------ */
.customer-layout {
    display: flex;
    min-height: 100vh;
}

.customer-main {
    flex: 1;
    background: #F8FAFC;
    transition: margin .25s ease;
}

.customer-content {
    padding: 32px;
}

/* ---------------------------------------------------------------
   3. Customer Header
   ------------------------------------------------------------ */
.customer-header {
    height: 72px;
    background: var(--ptc-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid var(--ptc-border);
}

.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--ptc-border);
    border-radius: 10px;
    background: var(--ptc-white);
    color: var(--ptc-text);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--ptc-bg);
}

html.sidebar-collapsed-init .sidebar {
    width: 76px;
}

html.sidebar-collapsed-init .brand-tagline,
html.sidebar-collapsed-init .brand-name span,
html.sidebar-collapsed-init .menu-item span:not(.menu-icon),
html.sidebar-collapsed-init .logout-btn {
    display: none;
}

html.sidebar-collapsed-init .sidebar-brand {
    padding: 24px 16px;
    text-align: center;
}

html.sidebar-collapsed-init .brand-name {
    font-size: 18px;
}

html.sidebar-collapsed-init .menu-item {
    justify-content: center;
    padding: 12px;
}

html.sidebar-collapsed-init .menu-icon {
    width: auto;
    font-size: 20px;
}

html.sidebar-collapsed-init .sidebar-footer {
    padding: 16px;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 90;
}

.user-menu {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ptc-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.user-name {
    font-size: 14px;
    line-height: 1.2;
    color: var(--ptc-dark);
}

.user-type {
    font-size: 13px;
    color: var(--ptc-text-muted);
    margin-top: 2px;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: var(--ptc-white);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
    padding: 10px 0;
    display: none;
    z-index: 100;
}

.user-dropdown.show {
    display: block;
}

.dropdown-arrow {
    font-size: 12px;
    color: var(--ptc-text-muted);
}

.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 18px;

    background: transparent;
    border: none;
    appearance: none;
    text-decoration: none;
    font: inherit;

    font-size: 14px;
    line-height: 1.2;
    text-align: left;
    color: var(--ptc-text);
    cursor: pointer;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: var(--ptc-bg);
}

/* ---------------------------------------------------------------
   4. Customer Sidebar
   ------------------------------------------------------------ */
.sidebar {
    width: 260px;
    background: var(--ptc-dark);
    color: var(--ptc-white);
    display: flex;
    flex-direction: column;
    transition: width .25s ease;
    overflow: hidden;
}

/* Sidebar thu gọn */
.customer-layout.sidebar-collapsed .sidebar {
    width: 76px;
}

.customer-layout.sidebar-collapsed .brand-tagline,
.customer-layout.sidebar-collapsed .brand-name span,
.customer-layout.sidebar-collapsed .menu-item span:not(.menu-icon),
.customer-layout.sidebar-collapsed .logout-btn {
    display: none;
}

.customer-layout.sidebar-collapsed .sidebar-brand {
    padding: 24px 16px;
    text-align: center;
}

.customer-layout.sidebar-collapsed .brand-name {
    font-size: 18px;
}

.customer-layout.sidebar-collapsed .menu-item {
    width: 48px;
    height: 48px;

    padding: 0;
    margin: 0 auto;

    justify-content: center;
    align-items: center;

    border-radius: 12px;
}

.customer-layout.sidebar-collapsed .menu-icon {
    width: auto;
    font-size: 20px;
}

.customer-layout.sidebar-collapsed .sidebar-footer {
    padding: 16px;
}

.sidebar-brand {
    padding: 24px;
}

.sidebar-menu {
    flex: 1;
    padding: 20px;
}

.sidebar-footer {
    padding: 24px;
}

.brand-name {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

.brand-name span {
    color: var(--ptc-primary);
}

.brand-tagline {
    font-size: 12px;
    color: #94A3B8;
    margin-top: 5px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;
    min-height: 48px;

    padding: 12px 16px;
    border-radius: 12px;

    color: var(--ptc-sidebar-text);
    text-decoration: none;
    transition: .2s ease;
}

.menu-item.active {
    background: var(--ptc-primary);
    color: var(--ptc-white);
}

.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;

    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;

    color: white;
    background: rgba(255, 255, 255 , 0.08);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ---------------------------------------------------------------
   5. Shared Components
   ------------------------------------------------------------ */
/* --------------- 5.1 Alerts --------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    width: 100%;
    margin-bottom: 24px;
    padding: 14px 18px;

    border: 1px solid transparent;
    border-radius: 8px;

    font-size: 15px;
    line-height: 1.5;
}

.alert-success {
    background: #F0FDF4;
    color: #166534;
    border-color: #BBF7D0;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-warning {
    background: #FEFCE8;
    color: #A16207;
    border-color: #FDE68A;
}

.alert-danger {
    background: #FEF2F2;
    color: #991B1B;
    border-color: #FECACA;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert li + li {
    margin-top: 4px;
}

.form-error {
    margin-top: 6px;
    color: #DC2626;
    font-size: 13px;
    line-height: 1.4;
}

/* --------------- 5.2 Badges --------------- */
.badge-primary {
    background: #DBEAFE;
    color: #1D4ED8;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.badge-success {
    background: #DCFCE7;
    color: #15803D;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.badge-info {
    background: #CCFBF1;
    color: #0F766E;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.badge-warning {
    background: #FEF3C7;
    color: #B45309;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.badge-danger {
    background: #FEE2E2;
    color: #DC2626;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

/* --------------- 5.3 Buttons --------------- */
.btn-primary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 0 20px;

    border-radius: 8px;

    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;
    text-decoration: none;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.btn-primary {
    background: var(--ptc-primary);
    color: var(--ptc-white);
    border: 1px solid var(--ptc-primary);
}

.btn-primary:hover {
    background: var(--ptc-primary-hover);
    border-color: var(--ptc-primary-hover);
}

.btn-outline {
    background: var(--ptc-white);
    color: var(--ptc-primary);
    border: 1px solid var(--ptc-primary);
}

.btn-outline:hover {
    background: #EFF6FF;
    color: var(--ptc-primary-hover);
    border-color: var(--ptc-primary-hover);
}

.btn-primary:focus-visible,
.btn-outline:focus-visible {
    outline: 3px solid rgba(10, 132, 255, 0.2);
    outline-offset: 2px;
}

.auth-submit {
    width: 100%;
}

.btn-block {
    width: 100%;
}

/* --------------- 5.4 Forms --------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
}

.form-control:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

.form-control:readonly {
    background: var(--ptc-bg);
    color: var(--ptc-text-muted);
}

textarea.form-control {
    resize: vertical;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    display: flex;
    align-items: center;
    justify-content: center;

    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    width: 24px;
    height: 24px;
    right: 16px;

    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
}

.password-toggle-icon {
    width: 20px;
    height: 20px;
    display: block;
    stroke-width: 2;
}

.form-help {
    margin-top: 6px;
    font-size: 13px;
    color: var(--ptc-text-muted);
    line-height: 1.5;
}

/* --------------- 5.5 Summary Components --------------- */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.summary-card {
    background: var(--ptc-white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.summary-title {
    color: var(--ptc-text-muted);
    margin-bottom: 10px;
}

.summary-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--ptc-primary);
}

.summary-value.success { color: #16A34A; }
.summary-value.warning { color: #D97706; }
.summary-value.danger  { color: #DC2626; }

.summary-meta {
    margin-top: 4px;
    font-size: 14px;
    font-style: italic;
    color: var(--ptc-text-muted);
    font-weight: 500;
}

/* --------------- 5.6 Shared Toolbar --------------- */
.portal-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 18px 0;
    flex-wrap: wrap;
}

.portal-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 320px;
}

.portal-search {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
}

.portal-search-result {
    margin: 15px 0;
    color: #475569;
    font-size: 15px;
}

/* --------------- 5.7 Shared Layout --------------- */
.portal-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.portal-grid-equal {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.portal-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

/* --------------- 5.8 Shared Cards --------------- */
.portal-card {
    background: var(--ptc-white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15,23,42,.05);
    overflow: hidden;
}

.portal-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.portal-record-header {
    display: flex;
    align-items: center;
    gap: 60px;

    padding-bottom: 6px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--ptc-border);
}

.portal-record-header > :last-child {
    margin-left: auto;
    text-align: right;
}

.portal-record-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto;
    align-items: center;
    gap: 20px;
}

.portal-record-info label {
    display: block;
    color: var(--ptc-text-muted);
    font-size: 14px;
    margin-bottom: 2px;
}


/* --------------- 5.9 Shared Tables --------------- */
.portal-table {
    width: 100%;
    border-collapse: collapse;
}

.portal-table td,
.portal-table th {
    padding: 12px 0;
    border-bottom: 1px solid var(--ptc-border);
}

.portal-table-info td:first-child,
.portal-table-summary td:first-child {
    width: 220px;
    color: var(--ptc-text-muted);
    font-weight: 500;
}

.portal-table-info td:last-child {
    text-align: right;
    color: var(--ptc-dark);
}

.portal-table-items th {
    text-align: left;
    color: var(--ptc-text-muted);
    font-size: 14px;
    font-weight: 600;
}

.portal-table-summary tr:last-child td {
    padding-top: 18px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: none;
}

.portal-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.portal-table-responsive .portal-table {
    min-width: 640px;
}

/* --------------- 5.10 Empty State --------------- */
.portal-empty {
    background: var(--ptc-white);
    border: 1px solid var(--ptc-border);
    border-radius: 14px;
    padding: 36px 24px;
    text-align: center;
    box-shadow: var(--ptc-shadow);
}

.portal-empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
    line-height: 1;
}

.portal-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ptc-primary);
    margin-bottom: 8px;
}

.portal-empty-description {
    color: var(--ptc-text-muted);
    line-height: 1.6;
}

/* --------------- 5.11 Shared Actions --------------- */
.portal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* ---------------------------------------------------------------
   6. Shared Page Elements
   ------------------------------------------------------------ */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    margin-bottom: 6px;
}

.page-header h2 {
    margin-bottom: 3px;
}

.page-subtitle {
    color: var(--ptc-text-muted);
}

.page-back {
    margin-bottom: 20px;
}

.page-back a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.page-back a:hover {
    text-decoration: underline;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--ptc-border);
}

.card-body {
    padding: 24px;
}

.card-description {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

/* ---------------------------------------------------------------
   7. Dashboard Page
   ------------------------------------------------------------ */
.dashboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ptc-border);
}

.dashboard-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ticket-id {
    color: #2563eb;
    font-weight: 700;
}

.dashboard-footer {
    margin-top: 24px;
    text-align: right;
    font-size: 13px;
    color: var(--ptc-text-muted);
}

/* ---------------------------------------------------------------
   8. Services Page
   ------------------------------------------------------------ */
.service-inactive {
    opacity: 0.6;
}

.service-main {
    flex: 0 0 180px;
}

.service-main h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--ptc-dark);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.service-product {
    flex: 0 0 180px;
    font-size: 15px;
}

.service-product strong {
    font-weight: 500;
    color: var(--ptc-dark);
    line-height: 1.4;
}

.service-product p {
    color: var(--ptc-text-muted);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.service-code {
    flex: 0 0 150px;
    font-size: 14px;
}

.service-code label {
    display: block;
    color: #94A3B8;
    margin-bottom: 3px;
}

.service-code strong {
    display: block;
    color: var(--ptc-dark);
    font-weight: 500;
}

.service-type {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
}

.service-type.domain {
    background: #FEF3C7;
    color: #B45309;
}

.service-type.hosting {
    background: #DBEAFE;
    color: #1D4ED8;
}

.service-type.email {
    background: #EDE9FE;
    color: #6D28D9;
}

.service-type.other {
    background: #DCFCE7;
    color: #15803D;
}

.service-feature-unlimited {
    color: #15803D;
    font-weight: 600;
}

.service-feature-empty {
    text-align: center;
    padding: 10px 20px;
    color: var(--ptc-dark);
}

/* ---------------------------------------------------------------
   9. Invoice Page
   ------------------------------------------------------------ */
.invoice-main {
    font-size: 15px;
}

.invoice-main h3 {
    margin-bottom: 3px;
}

.invoice-code p {
    color: var(--ptc-dark);
}

/* ---------------------------------------------------------------
   10. Ticket Page
   ------------------------------------------------------------ */
.ticket-main {
    font-size: 15px;
}

.ticket-main h3 {
    margin-bottom: 3px;
}

.ticket-main p {
    color: var(--ptc-dark);
}

.info-item label {
    display: block;
    margin-bottom: 6px;
    color: var(--ptc-text-muted);
    font-size: 13px;
}

.info-item strong {
    color: var(--ptc-dark);
    font-size: 15px;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.conversation-item {
    border: 1px solid var(--ptc-border);
    border-radius: 12px;
    padding: 16px 18px;
    background: var(--ptc-white);
}

.conversation-customer {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
}
.conversation-customer .conversation-item-header {
    background: #dcfce7;
    border-bottom-color: #bbf7d0;
}

.conversation-support {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
}
.conversation-support .conversation-item-header {
    background: #dbeafe;
    border-bottom-color: #bfdbfe;
}

.conversation-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;

    margin: -16px -18px 16px;
    padding: 8px 18px;

    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px 12px 0 0;
}

.conversation-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.conversation-date {
    font-size: 13px;
    color: var(--ptc-text-muted);
    white-space: nowrap;
}

.conversation-message {
    white-space: pre-wrap;
    line-height: 1.7;
    color: #1e293b;
    font-size: 15px;
}

/* ---------------------------------------------------------------
   11. Profile Page
   ------------------------------------------------------------ */
.profile-card-legal {
    grid-column: 1 / -1;
}

.profile-card-legal .form-row {
    grid-template-columns: repeat(3, 1fr);
}

.profile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.security-item + .security-item {
    border-top: 1px solid var(--ptc-border);
}

.security-item p {
    margin-top: 4px;
    color: var(--ptc-text-muted);
    font-size: 14px;
}

/* OTP Modal */
.portal-modal {
    width: min(480px, calc(100vw - 32px));
    border: none;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    margin: auto;
    inset: 0;
}

.portal-modal::backdrop {
    background: rgba(15,23,42,.45);
}

.portal-modal .text-meta {
    margin: 10px 0 12px;
}

.portal-modal-header {
    margin-bottom: 20px;
}

.portal-modal-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.portal-modal-header-top h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.portal-modal-close-button {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.portal-modal-close-button:hover {
    color: #334155;
}

.otp-inputs {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    margin-bottom: 18px;
}

.otp-input {
    width: 56px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 1px solid #d0d7e2;
    border-radius: 12px;
    outline: none;
}

.otp-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* OTP resend button */
#resendOtpButton:disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}

#resendOtpButton:disabled:hover {
    background: inherit;
    color: inherit;
}

/* ---------------------------------------------------------------
   12. Utilities
   ------------------------------------------------------------ */
.text-success { color: #16A34A; }
.text-warning { color: #F59E0B; }
.text-danger { color: #DC2626; }
.text-secondary { color: var(--ptc-dark); }

.text-muted { color: var(--ptc-text-muted); }
.text-meta {
    font-size: 13px;
    color: var(--ptc-text-muted);
}

.text-right {
    text-align: right;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.w-full { width: 100%; }

.section-description {
    font-size: 14px;
    color: var(--ptc-text-muted);
    line-height: 1.6;
}

/* ---------------------------------------------------------------
   13. Responsive
--------------------------------------------------------------- */

/* =============== Tablet Landscape (≤1200px) =============== */
@media (max-width: 1200px) {

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portal-grid {
        grid-template-columns: 1fr;
    }

    .portal-grid-equal {
        grid-template-columns: 1fr;
    }

    .portal-record-header {
        gap: 24px;
    }

}

/* ========== Tablet Portrait & Mobile Menu (≤992px) ===== */
@media (max-width: 992px) {

    /* ---------- Layout ---------- */
    .customer-header {
        padding: 0 18px;
    }

    .customer-content {
        padding: 24px 20px;
    }

    /* ---------- Sidebar ---------- */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;

        width: 260px;
        height: 100vh;

        z-index: 100;

        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    .customer-layout.sidebar-collapsed .sidebar {
        width: 260px;
        transform: translateX(-100%);
    }

    .customer-layout.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .customer-layout.sidebar-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    /* ---------- Header ---------- */
    .user-info,
    .dropdown-arrow {
        display: none;
    }

    /* ---------- Summary ---------- */
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .summary-card {
        padding: 18px;
    }

    .summary-value {
        font-size: 28px;
    }

    /* ---------- Toolbar ---------- */
    .portal-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .portal-toolbar-left {
        min-width: unset;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .portal-search {
        max-width: none;
    }

    /* ---------- Record Header ---------- */
    .portal-record-header {
        flex-wrap: wrap;
        gap: 20px;
    }

    .portal-record-header > div:last-child {
        margin-left: 0;
        text-align: left;
    }

    .service-main,
    .service-product,
    .service-code {
        flex: 1 1 calc(50% - 10px);
    }

    /* ---------- Record Info ---------- */
    .portal-record-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 16px;
    }

    .portal-actions {
        justify-content: flex-start;
    }

    .portal-actions .btn-outline,
    .portal-actions .btn-primary {
        width: 100%;
    }

    /* ---------- Invoice / Ticket ---------- */
    .invoice-main,
    .ticket-main {
        width: 100%;
    }

    .invoice-main h3,
    .ticket-main h3 {
        overflow-wrap: anywhere;
    }

    .portal-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .conversation-item-header {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .conversation-date {
        white-space: normal;
    }

    .form-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    /* ---------- Tables ---------- */
    .portal-table-info td:first-child,
    .portal-table-summary td:first-child,
    .portal-table td:first-child {
        width: 42%;
        min-width: 180px;
    }

    /* ---------- Profile ---------- */
    .profile-card-header {
        flex-wrap: wrap;
        gap: 16px;
    }

    .profile-card-header .btn-outline {
        width: 100%;
    }

    .security-item {
        gap: 20px;
    }

    .security-item .portal-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .security-item .portal-actions form {
        width: 100%;
    }

    .security-item .portal-actions .btn-outline {
        width: 100%;
    }

    /* ---------- OTP Modal ---------- */
    .portal-modal {
        width: min(520px, calc(100vw - 32px));
    }

    .portal-modal-header-top {
        gap: 12px;
    }
}

/* ==================== Mobile (≤768px) ==================== */
@media (max-width: 768px) {

    /* ---------- Layout ---------- */
    .customer-header {
        height: 64px;
        padding: 0 16px;
    }

    .customer-content {
        padding: 20px 16px;
    }

    /* ---------- Typography ---------- */
    .page-header {
        margin-bottom: 24px;
    }

    .page-header h1 {
        font-size: 28px;
        line-height: 1.2;
    }

    .page-header h2 {
        font-size: 22px;
    }

    .page-subtitle {
        margin-top: 6px;
        line-height: 1.5;
    }

    /* ---------- Summary ---------- */
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        padding: 20px;
    }

    .summary-value {
        font-size: 30px;
    }

    /* ---------- Cards ---------- */
    .card-header,
    .card-body {
        padding: 18px;
    }

    /* ---------- Dashboard ---------- */
    .dashboard-footer {
        text-align: left;
        line-height: 1.5;
    }
    
    /* ---------- Service List ---------- */
    .portal-record-header {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px 18px;
        align-items: start;
    }

    .service-main {
        grid-column: 1 / -1;
    }

    .service-product,
    .service-code {
        width: 100%;
        min-width: 0;
    }

    .portal-record-header > .badge-success,
    .portal-record-header > .badge-primary,
    .portal-record-header > .badge-warning,
    .portal-record-header > .badge-danger {
        grid-column: 2;
        justify-self: end;
        align-self: start;
    }

    .portal-record-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px 16px;
        align-items: start;
    }

    .portal-record-info label {
        margin-bottom: 4px;
    }

    /* ---------- Tables ---------- */
    .portal-table td,
    .portal-table th {
        padding: 10px 0;
    }

    .portal-table-info td:first-child,
    .portal-table-summary td:first-child,
    .portal-table td:first-child {
        width: 42%;
        min-width: 140px;
        color: var(--ptc-text-muted);
    }

    /* ---------- Invoice Detail ---------- */
    .portal-table-responsive {
        margin: 0 -18px;
        padding: 0 18px;
    }

    .portal-table-responsive .portal-table {
        min-width: 640px;
    }

    .portal-table-items th,
    .portal-table-items td {
        white-space: nowrap;
    }

    .portal-table-items td:first-child {
        white-space: normal;
        min-width: 240px;
    }

    .portal-table-items td:nth-child(2) {
        white-space: normal;
        min-width: 180px;
    }

    /* ---------- Invoice / Ticket Info ---------- */
    .portal-info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .info-item {
        padding: 0;
    }

    /* ---------- Ticket Conversation ---------- */
    .conversation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .conversation-item-header {
        margin-bottom: 14px;
    }

    .conversation-user {
        flex-wrap: wrap;
    }

    .conversation-message {
        font-size: 14px;
        line-height: 1.6;
    }

    /* ---------- Forms ---------- */
    .form-row {
        grid-template-columns: 1fr;
    }

    .profile-card-legal .form-row {
        grid-template-columns: 1fr;
    }

    .profile-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .security-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-actions .btn-primary,
    .form-actions .btn-outline {
        width: 100%;
    }

    /* ---------- Ticket Toolbar ---------- */
    .portal-toolbar .btn-primary,
    .portal-toolbar .btn-outline {
        width: 100%;
    }

    /* ---------- Profile ---------- */
    .portal-grid {
        grid-template-columns: 1fr;
    }

    .profile-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-card-header .btn-outline {
        width: 100%;
        text-align: center;
    }

    .security-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .security-item .portal-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .security-item .portal-actions form {
        width: 100%;
    }

    .security-item .badge-success,
    .security-item .badge-warning,
    .security-item .badge-primary,
    .security-item .badge-danger {
        align-self: flex-start;
    }

    /* ---------- Alerts ---------- */
    .alert {
        padding: 14px 16px;
    }

    .alert p {
        margin-top: 8px;
    }

    /* ---------- OTP Modal ---------- */
    .portal-modal {
        padding: 20px;
    }

    .portal-modal-header {
        margin-bottom: 20px;
    }

    .portal-modal-header h3 {
        font-size: 20px;
    }

    .portal-modal-header p {
        line-height: 1.5;
    }

    .otp-inputs {
        justify-content: space-between;
        gap: 10px;
    }

    .otp-input {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .portal-modal .portal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 12px;
    }

    .portal-modal .portal-actions .btn-primary,
    .portal-modal .portal-actions .btn-outline {
        width: 100%;
    }

    /* ---------- Password Page ---------- */
    .portal-card .portal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .portal-card .portal-actions .btn-primary,
    .portal-card .portal-actions .btn-outline {
        width: 100%;
    }
}

/* =============== Small Mobile (≤576px) =============== */
@media (max-width: 576px) {

    /* ---------- Layout ---------- */
    .customer-content {
        padding: 16px;
    }

    .brand-name {
        font-size: 24px;
    }

    /* ---------- Summary ---------- */
    .summary-card {
        padding: 18px;
    }

    .summary-value {
        font-size: 28px;
    }

    /* ---------- Action & Button ---------- */
    .portal-actions {
        flex-direction: column;
    }

    .portal-actions .btn-outline,
    .portal-actions .btn-primary {
        width: 100%;
    }

    .portal-modal {
        width: calc(100vw - 24px);
        padding: 20px;
    }

    .otp-inputs {
        justify-content: space-between;
        gap: 8px;
    }

    .otp-input {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    /* ---------- Conversation ---------- */
    .conversation-item {
        padding: 14px;
    }

    .conversation-item-header {
        margin: -14px -14px 14px;
        padding: 8px 14px;
    }

    /* ---------- Page Back ---------- */
    .page-back {
        margin-bottom: 16px;
    }

    .page-back a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    /* ---------- Badge ---------- */
    .badge-primary,
    .badge-success,
    .badge-warning,
    .badge-danger,
    .badge-info {
        font-size: 12px;
        padding: 5px 10px;
    }

    /* ---------- Profile ---------- */
    .page-header h1 {
        font-size: 24px;
    }

    .page-header h2 {
        font-size: 20px;
    }

    .portal-modal {
        width: calc(100vw - 24px);
        padding: 18px;
        border-radius: 16px;
    }

    .portal-modal-header-top {
        align-items: flex-start;
    }

    .portal-modal-close-button {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .otp-inputs {
        gap: 8px;
    }

    .otp-input {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .text-meta {
        line-height: 1.5;
    }
}
