/* ============================================
   TRANSITION Platform - Global Styles
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #E8740C;
    --primary-light: #F5A623;
    --primary-dark: #C45A00;
    --green: #2E8B57;
    --green-light: #4CAF50;
    --red: #E53935;
    --yellow: #FFC107;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    --white: #FFFFFF;
    --bg: #F0F0F0;
    --card-bg: #FFFFFF;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border: #E0E0E0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --sidebar-width: 70px;
    --header-height: 64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- Layout ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: transparent;
    position: fixed;
    top: calc(var(--header-height) + 10px);
    left: 10px;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 6px;
    gap: 0;
    overflow: hidden;
}

.app-main {
    flex: 1;
    margin-left: calc(var(--sidebar-width) + 20px);
    margin-top: calc(var(--header-height) + 10px);
    padding: 24px;
    min-height: calc(100vh - var(--header-height));
}

/* ---- Header ---- */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--header-height) + 10px);
    background: var(--bg);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 0;
    z-index: 200;
}

.app-header .header-logo {
    background: var(--white);
    border-radius: 40px;
    padding: 8px 20px 8px 10px;
    box-shadow: var(--shadow);
}

.app-header .header-right {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo img {
    height: 40px;
    width: 40px;
}

.header-logo span {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}

.header-logo .logo-subtitle {
    font-size: 10px;
    font-weight: 400;
    color: var(--primary);
    display: block;
    letter-spacing: 0;
    margin-top: -4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border-radius: 40px;
    padding: 6px 14px;
    box-shadow: var(--shadow);
}

.header-user-section {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: var(--white);
    border-radius: 40px;
    padding: 6px 14px 6px 8px;
    box-shadow: var(--shadow);
    transition: background 0.2s;
}

.header-user-section:hover {
    background: var(--gray-100);
}

.header-lang {
    position: relative;
    display: flex;
    align-items: center;
}

.lang-trigger {
    background: none;
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    font-size: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    overflow: hidden;
    transition: all 0.2s;
}

.lang-trigger:hover {
    border-color: var(--primary);
}

.lang-trigger svg {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 300;
    display: none;
    overflow: hidden;
}

.lang-dropdown.show {
    display: block;
}

.lang-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text);
    transition: background 0.2s;
}

.lang-dropdown button:hover {
    background: var(--gray-100);
}

.lang-dropdown button.active {
    background: rgba(232, 116, 12, 0.06);
    font-weight: 600;
}

.lang-dropdown button svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    color: var(--gray-600);
}

.header-icon-btn svg {
    width: 18px;
    height: 18px;
}

.header-icon-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.header-icon-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: var(--red);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}


.header-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.header-user-info {
    text-align: right;
}

.header-user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.header-user-email {
    font-size: 11px;
    color: var(--text-muted);
}

.header-user-chevron {
    color: var(--gray-500);
    flex-shrink: 0;
}

/* User dropdown menu */
.user-dropdown-menu {
    position: absolute;
    top: calc(var(--header-height) - 4px);
    right: 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 300;
    display: none;
    overflow: hidden;
}

.user-dropdown-menu.show {
    display: block;
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text);
    font-size: 14px;
    transition: background 0.2s;
}

.user-dropdown-menu a:hover {
    background: var(--gray-100);
}

.user-dropdown-menu a svg {
    width: 18px;
    height: 18px;
    color: var(--gray-500);
}

.user-dropdown-menu .divider {
    height: 1px;
    background: var(--border);
}

.user-dropdown-menu a.logout {
    color: var(--red);
}

/* ---- Sidebar Top ---- */
.sidebar-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    padding: 8px 4px;
    margin-bottom: 10px;
    background: var(--white);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.sidebar-top a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: all 0.2s;
    position: relative;
}

.sidebar-top a:hover {
    color: var(--primary);
}

.sidebar-top a.active {
    background: var(--primary);
    color: var(--white);
}

.sidebar-top a svg {
    width: 22px;
    height: 22px;
}

.sidebar-top a .tooltip {
    position: absolute;
    left: calc(100% + 8px);
    background: var(--gray-800);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 999;
}

.sidebar-top a:hover .tooltip {
    opacity: 1;
}

/* ---- Sidebar Nav ---- */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 8px 4px;
    background: var(--white);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.sidebar-nav a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: all 0.2s;
    position: relative;
}

.sidebar-nav a:hover {
    background: var(--gray-200);
    color: var(--primary);
}

.sidebar-nav a.active {
    background: var(--primary);
    color: var(--white);
}

.sidebar-nav a.active:hover {
    background: var(--primary-dark);
}

.sidebar-nav a svg {
    width: 22px;
    height: 22px;
}

.sidebar-nav a .tooltip {
    position: absolute;
    left: calc(100% + 8px);
    background: var(--gray-800);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 999;
}

.sidebar-nav a:hover .tooltip {
    opacity: 1;
}

/* ---- Cards ---- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    min-width: 0;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.card-value.small {
    font-size: 20px;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.card-positive {
    color: var(--green);
    font-size: 13px;
    font-weight: 500;
}

.card-negative {
    color: var(--red);
    font-size: 13px;
    font-weight: 500;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon.orange {
    background: #FFF3E0;
    color: var(--primary);
}

.card-icon.green {
    background: #E8F5E9;
    color: var(--green);
}

.card-icon.red {
    background: #FFEBEE;
    color: var(--red);
}

/* ---- Grid ---- */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.grid-1-2 { grid-template-columns: 1fr 2fr; }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-1-1 { grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 1024px) {
    .grid-3, .grid-4, .grid-1-1-1 { grid-template-columns: repeat(2, 1fr); }
    .grid-1-2, .grid-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .app-sidebar { display: none; }
    .app-main { margin-left: 0; }
}

/* ---- Page Header ---- */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.page-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-icon svg {
    width: 24px;
    height: 24px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: var(--font);
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-green {
    background: var(--green);
    color: white;
}
.btn-green:hover {
    background: #256D46;
}

.btn-red {
    background: var(--red);
    color: white;
}
.btn-red:hover {
    background: #C62828;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover {
    background: var(--gray-100);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Tables ---- */
.table-container {
    overflow-x: auto;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.table-header-left {
    font-size: 20px;
    font-weight: 700;
}

.table-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--text);
}

tbody tr:hover {
    background: var(--gray-100);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ---- Status Badges ---- */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pending {
    background: #FFF8E1;
    color: #F57F17;
}

.badge-in-progress,
.badge-active {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-completed {
    background: #E3F2FD;
    color: #1565C0;
}

.badge-expired,
.badge-closed {
    background: #FAFAFA;
    color: var(--gray-500);
}

.badge-frozen {
    background: #FFEBEE;
    color: var(--red);
}

/* ---- Progress Bar ---- */
.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--gray-200);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-bar .fill.orange {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.progress-bar .fill.green {
    background: linear-gradient(90deg, var(--green), var(--green-light));
}

.progress-bar .fill.red {
    background: linear-gradient(90deg, var(--red), #FF7043);
}

/* Expiration bar (like in CIP list) */
.expiration-bar {
    width: 80px;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.expiration-bar .fill {
    height: 100%;
    border-radius: 4px;
}

/* ---- Password Toggle & Checkbox ---- */
.input-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-password-wrap .form-input {
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--text);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
}

/* ---- Register Avatar Upload ---- */
.reg-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 18px;
}

.reg-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gray-100);
    border: 3px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
    position: relative;
}

.reg-avatar:hover {
    border-color: var(--primary);
    background: rgba(232, 116, 12, 0.06);
}

.reg-avatar svg {
    width: 32px;
    height: 32px;
    color: var(--gray-400);
}

.reg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reg-avatar-label {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 6px;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 116, 12, 0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ---- Select Dropdown ---- */
.select-wrapper {
    position: relative;
    display: inline-block;
}

.select-wrapper select {
    appearance: none;
    padding-right: 32px;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--gray-500);
    pointer-events: none;
}

/* ---- Search Input ---- */
.search-input {
    position: relative;
}

.search-input input {
    padding-left: 36px;
}

.search-input svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--gray-400);
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text);
    transition: all 0.2s;
}

.pagination button:hover {
    background: var(--gray-100);
}

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ---- Toast ---- */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--gray-400);
}

.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--yellow); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ---- Ticket Reply Box ---- */
.ticket-reply-box {
    background: #E8F5E9;
}

/* ---- CIP Badges (visual icons) ---- */
.cip-badges {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.cip-badge {
    text-align: center;
}

.cip-badge-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
    overflow: hidden;
}

.cip-badge-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cip-badge-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.cip-badge-count {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

/* ---- Network Donut Charts ---- */
.donut-chart {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-chart .donut-value {
    font-size: 16px;
    font-weight: 700;
}

.donut-chart .donut-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
}

/* ---- Referral Link Box ---- */
.referral-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-100);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

.referral-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text);
    font-family: var(--font);
}

.referral-box input:focus {
    outline: none;
}

.referral-box button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    padding: 4px;
}

.referral-box button:hover {
    color: var(--primary);
}

/* ---- Membership Plan Cards ---- */
.plan-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    text-align: left;
    border: 2px solid var(--border);
    transition: all 0.2s;
}

.plan-card:hover {
    border-color: var(--primary);
}

.plan-card.active {
    border-color: var(--green);
}

.plan-name {
    font-size: 18px;
    font-weight: 700;
}

.plan-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.plan-details {
    margin: 12px 0;
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.8;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.card-icon svg {
    width: 22px;
    height: 22px;
}

/* ---- Copy to clipboard ---- */
.copy-btn {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--gray-500);
    padding: 4px;
    transition: color 0.2s;
}

.copy-btn svg {
    width: 14px;
    height: 14px;
}

.copy-btn:hover {
    color: var(--primary);
}

/* ---- Utility ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-green { color: var(--green) !important; }
.text-red { color: var(--red) !important; }
.text-orange { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-bold { font-weight: 700; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 18px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mr-1 { margin-right: 8px; }
.ml-1 { margin-left: 8px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-full { width: 100%; }
.hidden { display: none !important; }

/* ---- Loading Spinner ---- */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .app-main {
        padding: 16px;
    }
    
    .page-title {
        font-size: 22px;
    }
    
    .card-value {
        font-size: 22px;
    }
    
    .modal {
        padding: 20px;
        margin: 16px;
    }
}

/* ---- Landing Page Specific ---- */
.landing-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 200;
}

.landing-header .header-logo {
    background: var(--white);
    border-radius: 40px;
    padding: 8px 20px 8px 10px;
    box-shadow: var(--shadow);
}

.landing-header .header-right {
    background: var(--white);
    border-radius: 40px;
    padding: 6px 14px;
    box-shadow: var(--shadow);
}

.landing-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    background: linear-gradient(135deg, #FFF8F0 0%, #F0F0F0 50%, #FFF3E0 100%);
}

.landing-hero h1 {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
}

.landing-hero h1 span {
    color: var(--primary);
}

.landing-hero p {
    font-size: 18px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 32px;
}

.landing-hero .btn-group {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.landing-section {
    padding: 80px 48px;
}

.landing-section h2 {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 1100px;
    margin: 0 auto;
}

.landing-feature {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow);
}

.landing-feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #FFF3E0;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.landing-feature h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.landing-feature p {
    font-size: 14px;
    color: var(--text-light);
}

.landing-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 40px 48px;
    text-align: center;
    font-size: 14px;
}

/* Auth Modal */
.auth-modal {
    max-width: 420px;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

/* Admin specific */
.admin-stat-card {
    text-align: center;
}

.admin-stat-card .stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

.admin-stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Quick action cards */
.qa-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.qa-card:hover {
    border-color: var(--primary);
    background: #FFF8F0;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.qa-card.qa-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: var(--primary);
    color: white;
}

.qa-card.qa-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow: 0 4px 12px rgba(232, 116, 12, 0.3);
}

.qa-card .qa-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qa-card.qa-primary .qa-icon {
    background: rgba(255,255,255,0.2);
}

.qa-card .qa-icon svg {
    width: 22px;
    height: 22px;
}

.qa-card .qa-label {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

/* Confirm modal */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.confirm-box h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.confirm-box p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
}

.confirm-box .confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Daily payment boxes */
.daily-payment-boxes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.daily-payment-box {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.daily-payment-box label {
    display: block;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 15px;
}

.daily-payment-box input {
    width: 120px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
}

.daily-payment-box input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Override button */
.btn-override {
    background: var(--red);
    color: white;
    border: 2px dashed #B71C1C;
}

.btn-override:hover {
    background: #C62828;
}

/* Alert banners */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius);
    border: 1px solid;
}

.alert-banner .alert-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-banner .alert-icon svg {
    width: 20px;
    height: 20px;
}

.alert-banner .alert-content {
    flex: 1;
}

.alert-banner .alert-content strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.alert-banner .alert-content p {
    font-size: 13px;
    margin: 0;
    opacity: 0.85;
}

.alert-warning {
    background: #FFF8E1;
    border-color: #FFB300;
    color: #795548;
}

.alert-warning .alert-icon {
    background: #FFB300;
    color: white;
}

.alert-danger {
    background: #FFEBEE;
    border-color: var(--red);
    color: #B71C1C;
}

.alert-danger .alert-icon {
    background: var(--red);
    color: white;
}

/* Form select */
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
    color: var(--text);
    appearance: auto;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 116, 12, 0.1);
}

/* Locked state */
.payment-locked {
    background: #FFEBEE;
    border: 2px solid var(--red);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    color: var(--red);
    font-weight: 600;
}

/* ---- Profile Picture Avatar ---- */
.header-user-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* ---- Dark Mode ---- */
[data-theme="dark"] {
    --bg: #1a1a2e;
    --white: #16213e;
    /* --card-bg: #16213e; */
    --card-bg: #132a54;
    --text: #e0e0e0;
    --text-light: #b0b0b0;
    --text-muted: #808080;
    --border: #2a2a4a;
    --gray-100: #1e1e3a;
    --gray-200: #2a2a4a;
    --gray-300: #3a3a5a;
    --gray-400: #5a5a7a;
    --gray-500: #7a7a9a;
    --gray-600: #9a9aba;
    --shadow: 0 2px 8px rgba(0,0,0,0.25);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.35);
}

[data-theme="dark"] body {
    background: var(--bg);
    color: var(--text);
}

[data-theme="dark"] .card {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .app-header {
    background: var(--bg);
}

[data-theme="dark"] .header-actions,
[data-theme="dark"] .header-user-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
}

[data-theme="dark"] .header-user-section:hover {
    background: var(--gray-200);
}

[data-theme="dark"] .app-header .header-logo {
    background: var(--card-bg);
    border: 1px solid var(--border);
}

[data-theme="dark"] .sidebar-top,
[data-theme="dark"] .sidebar-nav {
    background: var(--card-bg);
    border: 1px solid var(--border);
}

[data-theme="dark"] .app-sidebar a {
    color: var(--text-light);
}

[data-theme="dark"] .app-sidebar a:hover {
    color: var(--primary);
}

[data-theme="dark"] .app-sidebar a.active {
    color: #fff;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
    background: var(--gray-100);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .table-container,
[data-theme="dark"] table {
    color: var(--text);
}

[data-theme="dark"] thead th {
    background: var(--gray-200);
    color: var(--text-light);
}

[data-theme="dark"] tbody tr {
    border-color: var(--border);
}

[data-theme="dark"] tbody tr:hover {
    background: var(--gray-100);
}

[data-theme="dark"] .modal {
    background: var(--card-bg);
    color: var(--text);
}

[data-theme="dark"] .user-dropdown-menu {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .user-dropdown-menu a {
    color: var(--text);
}

[data-theme="dark"] .user-dropdown-menu a:hover {
    background: var(--gray-200);
}

[data-theme="dark"] .lang-dropdown {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .lang-dropdown button {
    color: var(--text);
}

[data-theme="dark"] .lang-dropdown button:hover {
    background: var(--gray-200);
}

[data-theme="dark"] .btn-outline {
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .badge {
    color: #fff;
}

[data-theme="dark"] .header-user-avatar {
    background: var(--primary);
    color: #fff;
}

[data-theme="dark"] .page-icon {
    background: var(--gray-200);
}

[data-theme="dark"] .ticket-reply-box {
    background: rgba(76, 175, 80, 0.1) !important;
    color: var(--text);
}

[data-theme="dark"] .ticket-reply-box .text-bold {
    color: var(--green);
}

[data-theme="dark"] .status-banner-warning {
    background: rgba(255, 193, 7, 0.12) !important;
    border-color: var(--yellow) !important;
}

[data-theme="dark"] .status-banner-warning strong {
    color: var(--yellow) !important;
}

[data-theme="dark"] .status-banner-success {
    background: rgba(76, 175, 80, 0.12) !important;
    border-color: var(--green) !important;
}

[data-theme="dark"] .status-banner-success strong {
    color: var(--green) !important;
}

[data-theme="dark"] .status-banner-success .text-sm,
[data-theme="dark"] .status-banner-warning strong,
[data-theme="dark"] .status-banner-warning .text-sm {
    color: var(--text);
}

[data-theme="dark"] .payment-locked {
    background: var(--gray-100);
    border-color: var(--border);
    color: var(--text);
}
