/* Profile Page Styles - Modern Design with 14px Base Spacing */

html {
    scroll-padding-top: 102px;
}

/* Hero Section */
.profile-hero {
    position: relative;
    height: 168px; /* 14 * 12 */
    margin-top: 70px; /* Account for fixed header height */
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></svg>') repeat;
    background-size: 56px; /* 14 * 4 */
    opacity: 0.5;
}

.profile-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(237, 28, 36, 0.15) 0%, transparent 50%);
}

.profile-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    padding: 14px;
}

.profile-hero-content h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 7px; /* 14 / 2 */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.profile-hero-content h1 i {
    color: #ed1c24;
}

.profile-hero-content p {
    font-size: 0.95rem;
    opacity: 0.85;
    margin: 0;
}

/* Main Content Area */
.profile-main {
    background: #f8f9fa;
    min-height: calc(100vh - 228px);
    padding: 0 0 56px; /* 14 * 4 */
}

.profile-main .container {
    max-width: 1176px; /* 14 * 84 */
    margin: 0 auto;
    padding: 0 14px;
}

/* Breadcrumb */
.profile-breadcrumb {
    padding: 14px 0;
    font-size: 0.875rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 7px; /* 14 / 2 */
}

.profile-breadcrumb a {
    color: #ed1c24;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 0.2s;
}

.profile-breadcrumb a:hover {
    color: #c41a22;
}

.profile-breadcrumb span {
    color: #999;
}

/* States */
.profile-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 70px 14px; /* 14 * 5 */
    text-align: center;
}

.profile-state .spinner {
    width: 42px; /* 14 * 3 */
    height: 42px;
    border: 3px solid #f0f0f0;
    border-top-color: #ed1c24;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.profile-state p {
    color: #666;
    font-size: 0.95rem;
}

/* Not Logged In Card */
.not-logged-in-card {
    background: white;
    border-radius: 14px;
    padding: 56px 42px; /* 14 * 4, 14 * 3 */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    max-width: 420px; /* 14 * 30 */
}

.not-logged-in-card .icon-wrapper {
    width: 84px; /* 14 * 6 */
    height: 84px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px; /* 14 * 2 */
}

.not-logged-in-card .icon-wrapper i {
    font-size: 2.5rem;
    color: #ed1c24;
}

.not-logged-in-card h2 {
    font-size: 1.4rem;
    color: #333;
    margin: 0 0 14px;
    font-weight: 600;
}

.not-logged-in-card p {
    color: #666;
    margin: 0 0 28px; /* 14 * 2 */
    line-height: 1.6;
}

/* Profile Login Card */
.profile-login-card {
    background: white;
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(226, 232, 240, 0.95);
    max-width: 460px;
    width: 100%;
}

.profile-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.profile-login-logo {
    height: 58px;
    margin-bottom: 22px;
}

.profile-login-header h2 {
    font-size: 1.5rem;
    color: #333;
    margin: 0 0 8px;
    font-weight: 600;
}

.profile-login-header p {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

.profile-login-form .form-group {
    margin-bottom: 20px;
}

.profile-login-form label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.profile-login-form .phone-input-group {
    display: flex;
    gap: 10px;
}

.profile-login-form .phone-prefix {
    width: 90px;
    height: 54px;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 0 12px;
    font-size: 1rem;
    background: #fff;
    cursor: pointer;
}

.profile-login-form .phone-prefix:focus {
    outline: none;
    border-color: #ed1c24;
}

.profile-login-form .form-control {
    flex: 1;
    height: 54px;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.profile-login-form .form-control:focus {
    outline: none;
    border-color: #ed1c24;
}

.profile-login-form .password-input-group {
    position: relative;
    display: flex;
}

.profile-login-form .password-input-group .form-control {
    padding-right: 50px;
}

.profile-login-form .password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 54px;
    width: 54px;
    border: 1px solid #ddd;
    border-left: none;
    border-radius: 0 12px 12px 0;
    background: #f8fafc;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-login-form .password-toggle:hover {
    color: #333;
    background: #f1f5f9;
}

.profile-login-form .form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.profile-login-form .remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
}

.profile-login-form .remember-me input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.profile-login-form .forgot-password {
    color: #ed1c24;
    font-size: 0.9rem;
    text-decoration: underline;
}

.profile-login-form .forgot-password:hover {
    color: #c0392b;
}

.profile-login-form .btn-login {
    width: 100%;
    min-height: 52px;
    background: linear-gradient(135deg, #ed1c24 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.profile-login-form .btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(237, 28, 36, 0.24);
}

.profile-login-form .btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.profile-login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eef2f7;
}

.profile-login-footer span {
    color: #666;
    font-size: 0.95rem;
}

.profile-login-footer a {
    color: #ed1c24;
    font-weight: 600;
    margin-left: 8px;
}

.profile-login-footer a:hover {
    text-decoration: underline;
}

/* Grid Layout */
.profile-grid {
    display: grid;
    grid-template-columns: 266px 1fr; /* 14 * 19 */
    gap: 28px; /* 14 * 2 */
    align-items: start;
}

/* Sidebar */
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.user-avatar-card {
    background: white;
    border-radius: 14px;
    padding: 28px; /* 14 * 2 */
    text-align: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.avatar-circle {
    width: 84px; /* 14 * 6 */
    height: 84px;
    background: linear-gradient(135deg, #ed1c24 0%, #c41a22 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 7px 21px rgba(237, 28, 36, 0.3);
}

.avatar-circle i {
    font-size: 2.25rem;
    color: white;
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Avatar Upload */
.avatar-upload-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 7px;
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #ed1c24 0%, #c41a22 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.avatar-upload-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(237, 28, 36, 0.4);
}

.avatar-upload-btn i {
    font-size: 0.75rem;
    color: white;
}

.avatar-delete-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.avatar-delete-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.avatar-delete-btn i {
    font-size: 0.65rem;
    color: white;
}

.avatar-hint {
    font-size: 0.75rem;
    color: #888;
    margin: 0 0 14px;
}

.user-avatar-card h3 {
    font-size: 1.1rem;
    color: #333;
    margin: 0 0 7px; /* 14 / 2 */
    font-weight: 600;
}

.user-avatar-card .user-phone {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 14px;
}

.role-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ed1c24 0%, #c41a22 100%);
    color: white;
    padding: 7px 14px; /* 14 / 2, 14 */
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Quick Links */
.quick-links {
    background: white;
    border-radius: 14px;
    padding: 7px; /* 14 / 2 */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    color: #555;
    text-decoration: none;
    border-radius: 7px; /* 14 / 2 */
    transition: all 0.2s;
    font-size: 0.9rem;
}

.quick-link:hover {
    background: #f8f9fa;
    color: #ed1c24;
}

.quick-link.active {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    color: #ed1c24;
    font-weight: 500;
}

.quick-link i {
    width: 14px;
    text-align: center;
}

/* Profile Forms */
.profile-forms {
    display: flex;
    flex-direction: column;
    gap: 28px; /* 14 * 2 */
}

/* Profile Card */
.profile-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.profile-card[id] {
    scroll-margin-top: 102px;
}

.profile-card .card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 21px 28px; /* 14 * 1.5, 14 * 2 */
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid #eee;
}

.profile-card .header-icon {
    width: 42px; /* 14 * 3 */
    height: 42px;
    background: linear-gradient(135deg, #ed1c24 0%, #c41a22 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-card .header-icon.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.profile-card .header-icon i {
    font-size: 1.15rem;
    color: white;
}

.profile-card .header-text h2 {
    font-size: 1.1rem;
    color: #333;
    margin: 0 0 3px;
    font-weight: 600;
}

.profile-card .header-text p {
    font-size: 0.85rem;
    color: #888;
    margin: 0;
}

.profile-card .card-body {
    padding: 28px; /* 14 * 2 */
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group {
    margin-bottom: 21px; /* 14 * 1.5 */
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 7px; /* 14 / 2 */
    margin-bottom: 7px;
    color: #444;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group label i {
    color: #ed1c24;
    font-size: 0.85rem;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e8e8e8;
    border-radius: 7px; /* 14 / 2 */
    font-size: 0.95rem;
    transition: all 0.2s;
    background: white;
    color: #333;
}

.form-group input:focus {
    outline: none;
    border-color: #ed1c24;
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.1);
}

.form-group input::placeholder {
    color: #aaa;
}

.form-group input.input-readonly,
.form-group input:disabled {
    background: #f8f9fa;
    color: #666;
    border-color: #e8e8e8;
    cursor: not-allowed;
}

.input-hint {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    font-size: 0.8rem;
    color: #888;
}

.input-hint i {
    font-size: 0.7rem;
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 42px; /* 14 * 3 */
}

.password-wrapper .toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 7px;
    transition: color 0.2s;
}

.password-wrapper .toggle-password:hover {
    color: #ed1c24;
}

/* Form Actions */
.form-actions {
    margin-top: 28px; /* 14 * 2 */
    padding-top: 21px; /* 14 * 1.5 */
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

/* Buttons */
.btn-primary,
.btn-warning,
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 12px 28px; /* 14 * 2 */
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #ed1c24 0%, #c41a22 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #c41a22 0%, #a01820 100%);
    transform: translateY(-2px);
    box-shadow: 0 7px 21px rgba(237, 28, 36, 0.35);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-outline {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-2px);
    box-shadow: 0 7px 21px rgba(245, 158, 11, 0.35);
}

.btn-outline:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 7px 21px rgba(148, 163, 184, 0.2);
}

.btn-primary:disabled,
.btn-warning:disabled,
.btn-outline:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Toast Styles */
.toast-container {
    position: fixed;
    bottom: 28px; /* 14 * 2 */
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.toast-notification {
    padding: 14px 21px; /* 14, 14 * 1.5 */
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    box-shadow: 0 7px 28px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 14px;
    animation: slideIn 0.3s ease;
    max-width: 364px; /* 14 * 26 */
}

.toast-notification.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast-notification.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast-notification.toast-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.toast-notification.toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.toast-notification.hiding {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Contracts Section */
.profile-card .header-icon.contracts {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* Contract Stats */
.contract-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 21px;
    border-bottom: 1px solid #eee;
}

.contract-stats .stat-item {
    text-align: center;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.2s;
}

.contract-stats .stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.contract-stats .stat-item .stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.contract-stats .stat-item .stat-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contract-stats .stat-item.active {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.contract-stats .stat-item.active .stat-number {
    color: #16a34a;
}

.contract-stats .stat-item.pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.contract-stats .stat-item.pending .stat-number {
    color: #d97706;
}

.contract-stats .stat-item.expired {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.contract-stats .stat-item.expired .stat-number {
    color: #dc2626;
}

/* Contracts List */
.contracts-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contracts-loading,
.contracts-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 42px;
    color: #666;
}

.contracts-error {
    color: #dc2626;
}

.contracts-loading i {
    color: #ed1c24;
}

/* Contract Card */
.contract-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.contract-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.contract-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e5e7eb;
}

.contract-number {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1e40af;
}

.contract-number i {
    color: #3b82f6;
}

.contract-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.contract-status.status-active {
    background: #dcfce7;
    color: #16a34a;
}

.contract-status.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.contract-status.status-expired {
    background: #fee2e2;
    color: #dc2626;
}

.contract-status.status-terminated {
    background: #f3f4f6;
    color: #6b7280;
}

.contract-status.status-renewed {
    background: #dbeafe;
    color: #2563eb;
}

.contract-body {
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.contract-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contract-info .info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #4b5563;
}

.contract-info .info-row i {
    width: 16px;
    color: #9ca3af;
    font-size: 0.85rem;
}

.contract-financial {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 18px;
    border-left: 1px solid #e5e7eb;
}

.contract-financial .financial-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contract-financial .label {
    font-size: 0.85rem;
    color: #6b7280;
}

.contract-financial .value {
    font-weight: 600;
    color: #ed1c24;
}

.contract-footer {
    padding: 10px 18px;
    background: #fef3c7;
    border-top: 1px solid #fde68a;
}

.expiry-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #d97706;
    font-weight: 500;
}

.expiry-warning i {
    color: #f59e0b;
}

.contract-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.contract-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.contract-action-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.contract-action-btn.secondary {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.contract-action-btn.secondary:hover {
    background: #ffedd5;
    border-color: #fdba74;
}

.invoice-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.invoice-detail-card,
.invoice-detail-section {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

.invoice-detail-card {
    padding: 16px;
}

.invoice-detail-card .label {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 6px;
}

.invoice-detail-card .value {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.invoice-detail-card .value.danger {
    color: #dc2626;
}

.invoice-detail-card .value.success {
    color: #16a34a;
}

.invoice-detail-section {
    overflow: hidden;
    margin-top: 18px;
}

.invoice-detail-section__header {
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

.invoice-detail-section__body {
    padding: 0 16px 16px;
}

.invoice-detail-empty {
    color: #6b7280;
    font-size: 0.9rem;
    padding-top: 16px;
}

.invoice-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-detail-table th,
.invoice-detail-table td {
    padding: 12px 0;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.invoice-detail-table th:last-child,
.invoice-detail-table td:last-child {
    text-align: right;
}

.invoice-detail-summary {
    margin-top: 18px;
    margin-left: auto;
    max-width: 360px;
    display: grid;
    gap: 10px;
}

.invoice-detail-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.9rem;
}

.invoice-detail-summary-row strong {
    color: #111827;
}

.profile-invoice-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
}

.profile-invoice-modal.is-open {
    display: block;
}

.profile-invoice-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(2px);
}

.profile-invoice-modal__dialog {
    position: relative;
    width: min(980px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    margin: 24px auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.profile-invoice-modal__header,
.profile-invoice-modal__footer {
    padding: 18px 22px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.profile-invoice-modal__header p {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.profile-invoice-modal__footer {
    border-bottom: 0;
    border-top: 1px solid #e5e7eb;
    justify-content: flex-end;
}

.profile-invoice-modal__body {
    padding: 22px;
    overflow: auto;
}

.profile-invoice-modal__close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.profile-invoice-modal__close:hover {
    background: #f8fafc;
    color: #111827;
}

/* Contract Files */
.contract-files {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.contract-files .files-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 10px;
}

.contract-files .files-label i {
    color: #9ca3af;
}

.contract-files .files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.contract-file-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s;
}

.contract-file-item:hover {
    background: #e5e7eb;
    color: #3b82f6;
}

.contract-file-item i {
    font-size: 1rem;
}

.contract-file-item i.fa-file-pdf {
    color: #ef4444;
}

.contract-file-item i.fa-file-word {
    color: #3b82f6;
}

.contract-file-item i.fa-file-image {
    color: #10b981;
}

/* No Contracts */
.no-contracts {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 28px;
    text-align: center;
    color: #9ca3af;
}

.no-contracts i {
    font-size: 3rem;
    margin-bottom: 14px;
    opacity: 0.5;
}

.no-contracts p {
    margin: 0;
    font-size: 1rem;
}

/* ==============================================
   MAINTENANCE REQUESTS SECTION
   ============================================== */

/* Maintenance Stats */
.maintenance-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.maintenance-stats .stat-item {
    text-align: center;
    padding: 14px 10px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transition: all 0.2s;
}

.maintenance-stats .stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.maintenance-stats .stat-item .stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.maintenance-stats .stat-item .stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
}

.maintenance-stats .stat-item.pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.maintenance-stats .stat-item.pending .stat-number {
    color: #d97706;
}

.maintenance-stats .stat-item.in-progress {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.maintenance-stats .stat-item.in-progress .stat-number {
    color: #2563eb;
}

.maintenance-stats .stat-item.resolved {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.maintenance-stats .stat-item.resolved .stat-number {
    color: #16a34a;
}

/* Maintenance List */
.maintenance-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.maintenance-loading,
.maintenance-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 42px;
    color: #666;
}

.maintenance-error {
    color: #dc2626;
}

.maintenance-loading i {
    color: #ed1c24;
}

/* Maintenance Card */
.maintenance-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.maintenance-card:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.maintenance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e5e7eb;
}

.maintenance-id {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #92400e;
}

.maintenance-id i {
    color: #f59e0b;
}

.maintenance-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.maintenance-status.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.maintenance-status.status-acknowledged {
    background: #dbeafe;
    color: #2563eb;
}

.maintenance-status.status-in-progress {
    background: #fed7aa;
    color: #c2410c;
}

.maintenance-status.status-resolved {
    background: #dcfce7;
    color: #16a34a;
}

.maintenance-status.status-cancelled {
    background: #f3f4f6;
    color: #6b7280;
}

.maintenance-body {
    padding: 18px;
}

.maintenance-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.maintenance-info .info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #4b5563;
}

.maintenance-info .info-row i {
    width: 16px;
    color: #9ca3af;
    font-size: 0.85rem;
}

.maintenance-description {
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
}

.maintenance-description p {
    margin: 0;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.5;
}

.maintenance-images {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #6b7280;
}

.maintenance-images i {
    color: #9ca3af;
}

/* No Maintenance */
.no-maintenance {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 28px;
    text-align: center;
    color: #9ca3af;
}

.no-maintenance i {
    font-size: 3rem;
    margin-bottom: 14px;
    opacity: 0.5;
    color: #16a34a;
}

.no-maintenance p {
    margin: 0;
    font-size: 1rem;
}

/* Header icon for maintenance */
.header-icon.maintenance {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.header-icon.maintenance i {
    color: #d97706;
}

/* Header icon for documents */
.header-icon.documents {
    background: linear-gradient(135deg, #ed1c24, #c41920);
}

.header-icon.documents i {
    color: white;
}

/* Documents Section Styles */
.document-upload-section {
    margin-bottom: 1.5rem;
}

.upload-area {
    display: block;
    border: 2px dashed #ed1c24;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #fff5f5 0%, #fef0f0 100%);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #c41920;
    background: linear-gradient(135deg, #ffecec 0%, #ffe5e5 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(237, 28, 36, 0.15);
}

.upload-area.uploading {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.upload-area.uploading::after {
    content: 'Đang tải lên...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    color: #ed1c24;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-area i {
    font-size: 3.5rem;
    color: #ed1c24;
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.3s ease;
}

.upload-area:hover i {
    transform: scale(1.1);
}

.upload-area p {
    margin: 0 0 0.75rem;
    color: #374151;
    font-size: 1.05rem;
    font-weight: 500;
}

.upload-hint {
    font-size: 0.875rem;
    color: #9ca3af;
    display: block;
}

.btn-upload {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: #ed1c24;
    color: white;
    border: 2px solid #ed1c24;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(237, 28, 36, 0.25);
}

.btn-upload:hover {
    background: #c41920;
    border-color: #c41920;
    box-shadow: 0 4px 12px rgba(237, 28, 36, 0.35);
    transform: translateY(-1px);
}

.documents-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.document-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.document-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.document-preview {
    height: 180px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.document-preview img:hover {
    transform: scale(1.05);
}

.document-info {
    padding: 1rem;
}

.document-name {
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

.document-description {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.document-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.document-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.document-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 1rem 1rem;
    gap: 0.5rem;
}

.btn-action-edit,
.btn-action-delete {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.btn-action-edit {
    background: #e0f2fe;
    color: #0284c7;
}

.btn-action-edit:hover {
    background: #0284c7;
    color: white;
}

.btn-action-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-action-delete:hover {
    background: #dc2626;
    color: white;
}

.no-documents,
.documents-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem;
    color: #94a3b8;
    text-align: center;
}

.no-documents i,
.documents-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.documents-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #64748b;
}

/* Responsive Design */
@media (max-width: 992px) {
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .profile-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .quick-links {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .profile-hero {
        height: 140px; /* 14 * 10 */
        margin-top: 60px; /* Smaller header on mobile */
    }

    .profile-hero-content h1 {
        font-size: 1.4rem;
    }

    .profile-sidebar {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .profile-card .card-header {
        padding: 14px;
    }

    .profile-card .card-body {
        padding: 14px;
    }

    .form-actions {
        justify-content: center;
    }

    .btn-primary,
    .btn-warning,
    .btn-outline {
        width: 100%;
        justify-content: center;
    }

    .not-logged-in-card {
        padding: 28px 14px;
    }

    .profile-login-card {
        padding: 24px 16px;
        margin: 0 10px;
    }

    .profile-login-header h2 {
        font-size: 1.25rem;
    }

    .profile-login-form .phone-input-group {
        flex-direction: column;
        gap: 8px;
    }

    .profile-login-form .phone-prefix {
        width: 100%;
    }

    .toast-container {
        left: 14px;
        right: 14px;
        bottom: 14px;
    }

    .toast-notification {
        max-width: 100%;
    }

    /* Contracts responsive */
    .contract-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .contract-body {
        grid-template-columns: 1fr;
    }

    .contract-financial {
        padding-left: 0;
        padding-top: 14px;
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }

    .contract-actions {
        flex-direction: column;
    }

    .contract-action-btn {
        width: 100%;
        justify-content: center;
    }

    .invoice-detail-grid {
        grid-template-columns: 1fr;
    }

    .profile-invoice-modal__dialog {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        margin: 10px auto;
        border-radius: 14px;
    }

    .profile-invoice-modal__header,
    .profile-invoice-modal__body,
    .profile-invoice-modal__footer {
        padding: 16px;
    }

    .profile-invoice-modal__footer {
        flex-direction: column-reverse;
    }

    /* Maintenance responsive */
    .maintenance-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .profile-main .container {
        padding: 0 14px;
    }

    .avatar-circle {
        width: 70px; /* 14 * 5 */
        height: 70px;
    }

    .avatar-circle i {
        font-size: 1.75rem;
    }
}
