/* ==================== VARIABLES & GENERAL ==================== */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary-color: #ec4899;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    
    --bg-light: #f9fafb;
    --bg-lighter: #f3f4f6;
    --bg-white: #ffffff;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    
    --text-dark: #1f2937;
    --text-darker: #111827;
    --text-muted: #6b7280;
    --text-lighter: #9ca3af;
    
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body, #app {
    height: 100%;
}

/* ==================== LAYOUT ==================== */
#app {
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    user-select: none;
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px !important;
}

.logo-badge {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s ease;
}

.logo-badge:hover {
    transform: scale(1.05);
}

.sidebar-header span {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.5px;
}

.sidebar.collapsed .sidebar-header span {
    display: none;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
}

.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    height: var(--header-height);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.header-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px !important;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-left h1 {
    color: var(--text-darker);
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

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

.balance-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-light), rgba(236, 72, 153, 0.1));
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--primary-light);
}

.balance-indicator i {
    color: var(--primary-color);
    font-size: 16px;
}

.balance-indicator .balance-chevron {
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.dropdown.show .balance-indicator .balance-chevron {
    transform: rotate(180deg);
}

.balance-indicator:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.15));
    cursor: pointer;
}

.balance-dropdown {
    min-width: 280px;
    padding: 0;
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    margin-top: 10px !important;
}

.balance-dropdown-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.balance-dropdown-title {
    font-weight: 600;
    font-size: 14px;
}

.balance-dropdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    transition: background 0.2s ease;
}

.balance-dropdown-item:hover {
    background: var(--bg-light);
}

.balance-item-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.balance-item-icon.main {
    background: linear-gradient(135deg, var(--primary-light), rgba(99, 102, 241, 0.2));
    color: var(--primary-color);
}

.balance-item-icon.bonus {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.2));
    color: #f59e0b;
}

.balance-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.balance-item-label {
    font-size: 12px;
    color: var(--text-light);
}

.balance-item-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.balance-item-value.bonus-value {
    color: #f59e0b;
}

.balance-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 16px;
}

.balance-dropdown-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.balance-dropdown-action:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.balance-dropdown-action i {
    font-size: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 10px;
}

.user-profile:hover {
    background: var(--bg-light);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

.user-role {
    font-size: 12px;
    color: var(--text-lighter);
    font-weight: 500;
}

.page-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-light);
    padding: 32px;
}

.profiles-container {
    width: 100%;
}

/* ==================== NAVIGATION ==================== */
.nav {
    flex: 1;
    padding: 12px 8px;
    gap: 6px;
    display: flex;
    flex-direction: column;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    font-weight: 500;
    position: relative;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--bg-lighter);
    color: var(--text-dark);
    transform: translateX(2px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-light), rgba(236, 72, 153, 0.1));
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--primary-color);
}

.nav-link i {
    font-size: 16px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    transition: transform 0.2s ease;
}

.nav-link:hover i {
    transform: scale(1.1);
}

.nav-link span:first-of-type {
    flex: 1;
}

.nav-link .badge {
    font-size: 11px;
    padding: 4px 8px;
    margin-left: auto;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: white !important;
    font-weight: 600;
    border-radius: 6px;
}

.sidebar.collapsed .nav-link span:not(.badge),
.sidebar.collapsed .nav-link .badge {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

/* ==================== BUTTONS ==================== */
.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.btn-ghost:hover {
    background: var(--bg-lighter);
    color: var(--text-dark);
    transform: scale(1.05);
}

.btn-ghost:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ==================== SCROLLBAR ==================== */
.sidebar::-webkit-scrollbar,
.page-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.page-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.page-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.page-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--secondary-color));
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

/* ==================== CONTENT STYLES ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.page-header h2 {
    color: var(--text-darker);
    font-weight: 700;
    margin-bottom: 0;
    font-size: 32px;
    letter-spacing: -1.5px;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 14px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    color: white;
}

.btn-outline-primary {
    color: var(--primary-color);
    border: none;
    background: transparent;
    padding: 6px 8px;
    font-size: 13px;
    font-weight: 500;
}

.btn-outline-primary:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: transparent;
}

.btn-outline-danger {
    color: var(--danger-color);
    border: none;
    background: transparent;
    padding: 6px 8px;
    font-size: 13px;
    font-weight: 500;
}

.btn-outline-danger:hover {
    background: #fee2e2;
    color: var(--danger-color);
    border-color: transparent;
}

/* ==================== CONTRACTS GRID (CARDS) ==================== */
.contracts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Пустое состояние: на всю ширину сетки, контент по центру */
.contracts-empty-state {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42vh;
    padding: 2rem;
}

.contracts-empty-state-inner {
    text-align: center;
    max-width: 420px;
}

/* Contract Card */
.contract-card {
    background: var(--bg-white);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contract-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
    transform: translateY(-2px);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

/* Contract Create Page - Card Headers */
#step2scheduled .card-header.bg-light,
#step2automatic .card-header.bg-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-bottom: 2px solid #e0e0e0;
    padding: 12px 20px;
}

#step2scheduled .card-header h6,
#step2automatic .card-header h6 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-darker);
    margin: 0;
}

#step2scheduled .card-header i,
#step2automatic .card-header i {
    font-size: 16px;
}

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

.card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.contract-id {
    font-size: 14px;
    font-weight: 700;
    color: #6b7280;
    flex-shrink: 0;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    flex: 1;
}

.card-badge {
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.card-actions {
    display: flex;
    gap: 4px;
}

.card-dates-section {
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
}

.card-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin: 0 -20px;
    border-top: 1px solid #f3f4f6;
}

.btn-extend {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-extend:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.card-actions-icons {
    display: flex;
    gap: 6px;
}

/* Service Cards */
.service-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.service-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 24px;
    color: white;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.service-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1f2937;
}

.service-card p {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 16px;
    flex-grow: 1;
    line-height: 1.5;
}

.service-card .btn {
    margin-top: auto;
}

/* Info Card */
.info-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.info-card-header {
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    padding: 20px 28px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.info-card-header h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.info-card-body {
    padding: 28px;
}

.software-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 16px;
}

.software-item:last-child {
    margin-bottom: 0;
}

.software-logo {
    width: 56px;
    height: 56px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #6366f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.software-item h5 {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.software-item p {
    font-size: 13px;
}

/* Video Placeholder */
.video-placeholder {
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.video-placeholder:hover {
    border-color: #9ca3af;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.video-placeholder-content {
    max-width: 400px;
    margin: 0 auto;
}

.video-icon {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: #6366f1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.video-placeholder h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1f2937;
}

.video-placeholder p {
    margin-bottom: 16px;
}

/* Button Styles */
.btn-secondary {
    background: #e5e7eb;
    color: #6b7280;
    border: none;
}

.btn-secondary:hover {
    background: #d1d5db;
    color: #6b7280;
}

/* Balance Page */
.balance-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.balance-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.balance-card-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

.balance-card-label i {
    font-size: 16px;
}

.balance-card-value {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.balance-card-unit {
    font-size: 13px;
    color: #9ca3af;
}

.balance-card-clickable {
    cursor: pointer;
}

.balance-card-clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.2);
}

.balance-card-action-text {
    color: #1f2937 !important;
    font-size: 20px !important;
    line-height: 1.2;
}

.bg-gradient-purple {
    background: linear-gradient(135deg, #a855f7, #9333ea);
}

/* Transactions Card */
.transactions-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.transactions-header {
    padding: 28px;
    border-bottom: 1px solid #e5e7eb;
}

.transactions-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.search-box {
    position: relative;
    margin-top: 16px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.search-box input {
    padding-left: 36px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    font-size: 14px;
}

.search-box input:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

/* Transactions Table */
.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table thead {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.transactions-table th {
    padding: 16px 28px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transactions-table th:nth-child(1) {
    width: 22%;
}

.transactions-table th:nth-child(2) {
    width: 18%;
}

.transactions-table th:nth-child(3) {
    width: 15%;
}

.transactions-table th:nth-child(4) {
    width: 15%;
}

.transactions-table th:nth-child(5) {
    width: 30%;
}

.transactions-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

.transactions-table tbody tr:hover {
    background: #f9fafb;
}

.transactions-table td {
    padding: 16px 28px;
    font-size: 14px;
    color: #1f2937;
}

.transaction-row:last-child {
    border-bottom: none;
}

.contract-name {
    font-weight: 600;
    width: 22%;
}

.contract-type {
    width: 18%;
}

.start-date {
    width: 15%;
}

.balance-expire-date {
    width: 15%;
}

.type-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.type-automatic {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.type-scheduled {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.amount-cell {
    text-align: right;
}

.amount-value {
    font-weight: 600;
    color: #059669;
}

/* Refills Table */
.refill-date {
    width: 25%;
}

.refill-text {
    width: 45%;
}

.refill-amount {
    width: 30%;
    text-align: right;
}

.amount-value-positive {
    font-weight: 600;
    color: #059669;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.status-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Form Card */
.form-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.form-card-header {
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    padding: 32px;
    border-bottom: 1px solid #e5e7eb;
}

.form-card-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.form-card-header p {
    color: #6b7280;
    margin: 0;
    font-size: 14px;
}

.form-card form {
    padding: 32px;
}

/* Form Groups */
.form-group {
    margin-bottom: 28px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-label i {
    color: #6366f1;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #9ca3af;
}

/* Radio Cards */
.radio-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-card-content {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
    background: white;
}

.radio-card-content i {
    font-size: 32px;
    color: #9ca3af;
    margin-bottom: 12px;
    display: block;
}

.radio-card-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.radio-card-desc {
    display: block;
    font-size: 12px;
    color: #6b7280;
}

.radio-card input[type="radio"]:checked + .radio-card-content {
    border-color: #6366f1;
    background: #f5f7ff;
}

.radio-card input[type="radio"]:checked + .radio-card-content i {
    color: #6366f1;
}

.radio-card:hover .radio-card-content {
    border-color: #c7d2fe;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.file-upload-area i {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 16px;
    display: block;
}

.file-upload-area p {
    margin: 0 0 8px 0;
    color: #6b7280;
    font-size: 14px;
}

.file-upload-area small {
    color: #9ca3af;
    font-size: 12px;
}

.file-upload-area:hover {
    border-color: #6366f1;
    background: #f5f7ff;
}

.file-upload-area.drag-over {
    border-color: #6366f1;
    background: #eef2ff;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.file-info i {
    font-size: 24px;
    color: #6366f1;
}

.file-info span {
    flex: 1;
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

.btn-remove-file {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-remove-file:hover {
    background: #fee2e2;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Database Table */
.database-table th:nth-child(1) {
    width: 5%;
}

.database-table th:nth-child(2) {
    width: 18%;
}

.database-table th:nth-child(3) {
    width: 12%;
}

.database-table th:nth-child(4) {
    width: 20%;
}

.database-table th:nth-child(5) {
    width: 15%;
}

.database-table th:nth-child(6) {
    width: 15%;
}

.database-table th:nth-child(7) {
    width: 15%;
    text-align: right;
}

.database-table .db-id {
    text-align: center;
}

.database-table .db-actions {
    text-align: right;
}

/* Guide Card */
.guide-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.guide-header {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    padding: 24px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.guide-header i {
    font-size: 24px;
    color: #6366f1;
}

.guide-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.guide-content {
    padding: 32px;
}

.guide-intro {
    font-size: 15px;
    color: #4b5563;
    margin-bottom: 28px;
    line-height: 1.6;
}

.providers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 28px;
}

.provider-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.provider-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

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

.provider-header h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.provider-requirements {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.provider-requirements li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
    color: #4b5563;
}

.provider-requirements i {
    color: #10b981;
    font-size: 16px;
}

.provider-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 16px;
}

.price-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.price-value {
    font-size: 20px;
    font-weight: 700;
    color: #6366f1;
}

.guide-link {
    display: inline-flex;
    align-items: center;
    color: #6366f1;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.guide-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.guide-warning {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #fef3c7;
    border: 1.5px solid #fbbf24;
    border-radius: 12px;
}

.guide-warning i {
    font-size: 24px;
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 2px;
}

.guide-warning strong {
    display: block;
    font-size: 15px;
    color: #92400e;
    margin-bottom: 6px;
}

.guide-warning p {
    margin: 0;
    font-size: 14px;
    color: #78350f;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .providers-grid {
        grid-template-columns: 1fr;
    }
}

.btn-icon-only {
    background: transparent;
    border: none;
    color: #6b7280;
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 6px;
    font-size: 14px;
}

.btn-icon-only:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.btn-icon-only:nth-child(1):hover {
    color: #0369a1;
    background: #e0f2fe;
}

.btn-icon-only:nth-child(2):hover {
    color: #d97706;
    background: #fef3c7;
}

.btn-icon-only:nth-child(3):hover {
    color: #dc2626;
    background: #fee2e2;
}

/* Card Body */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
}

.card-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.info-label {
    color: #6b7280;
    font-weight: 500;
}

.info-value {
    color: #1f2937;
    font-weight: 600;
}

/* Card Footer */
.card-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-status {
    display: flex;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-text {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

.card-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-dates-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    margin-left: auto;
}

.card-date-item-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.date-label-small {
    color: #9ca3af;
    font-weight: 500;
}

.date-value-small {
    color: #6b7280;
    font-weight: 600;
}

.expire-date-small {
    font-weight: 600;
    font-size: 11px;
}

/* Expire date - с предупреждениями */
.expire-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    text-align: right;
}

.expire-date i {
    font-size: 12px;
}

.expire-date-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 6px 10px;
    border-radius: 6px;
}

.expire-date-danger {
    background: #fee2e2;
    color: #991b1b;
    padding: 6px 10px;
    border-radius: 6px;
    animation: pulse-danger 1.5s infinite;
}

@keyframes pulse-danger {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Actions - кнопки */
.btn-icon {
    background: transparent;
    border: none;
    color: #6b7280;
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 6px;
    font-size: 14px;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.btn-icon:first-child:hover {
    color: var(--primary-color);
}

.btn-icon:last-child:hover {
    color: #ef4444;
}

/* DB Connection Status */
.db-connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
}

/* DB Connection Status Compact (in header) */
.db-connection-status-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.db-status-running {
    background: #d1fae5;
    color: #065f46;
}

.db-status-error {
    background: #fee2e2;
    color: #991b1b;
}

.db-status-stopped {
    background: #f3f4f6;
    color: #374151;
}

.db-status-icon {
    font-size: 16px;
    line-height: 1;
}

.db-status-text {
    flex: 1;
}

/* Expire Progress Bar */
.expire-progress-bar {
    margin-top: 16px;
    padding-top: 16px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

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

.progress-success {
    background: linear-gradient(90deg, #10b981, #059669);
}

.progress-warning {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.progress-danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    animation: pulse-progress 2s infinite;
}

@keyframes pulse-progress {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.progress-label {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .contracts-grid {
        grid-template-columns: 1fr;
    }
}

.fw-500 {
    font-weight: 600;
    color: var(--text-darker);
    font-size: 15px;
}

.expire-date {
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

/* Modal Styles */
.modal-content {
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--bg-lighter), var(--bg-light));
    border-bottom: 1px solid var(--border-light);
    padding: 24px;
}

.modal-title {
    color: var(--text-darker);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-light);
    padding: 20px 24px;
    background: var(--bg-lighter);
}

.form-label {
    color: var(--text-darker);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
    letter-spacing: -0.3px;
}

.form-control,
.form-select {
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    background: var(--bg-white);
    transition: all 0.2s ease;
    font-weight: 500;
}

.form-control::placeholder {
    color: var(--text-lighter);
    font-weight: 500;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: var(--bg-white);
}

/* ==================== RESPONSIVE ==================== */

/* Overlay — скрыт по умолчанию, показывается на мобилке при открытом sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        width: var(--sidebar-width);
        z-index: 1050;
        transform: translateX(-100%);
        box-shadow: none;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    }

    /* Открытый sidebar на мобилке — полная ширина с текстом */
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }

    .main-content {
        width: 100%;
    }

    .header-left h1 {
        font-size: 16px;
    }

    .header-right {
        gap: 16px;
    }

    .user-info {
        display: none;
    }

    .balance-indicator span {
        display: none;
    }

    .balance-indicator i {
        display: inline;
    }

    .page-content {
        padding: 16px;
    }
}

@media (max-width: 576px) {
    .header-content {
        padding: 0 12px !important;
    }

    .header-left {
        gap: 12px;
    }

    .header-left h1 {
        font-size: 14px;
    }

    .header-right {
        gap: 8px;
    }
}

/* ==================== CONTRACT CREATE PAGE ==================== */

/* Contract Steps */
.contract-step {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mode Selection Cards */
.mode-card {
    background: white !important;
    border-radius: 16px !important;
    padding: 28px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    border: 2px solid transparent !important;
    cursor: pointer !important;
}

.mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.mode-card-header {
    text-align: center;
    margin-bottom: 24px;
}

.mode-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 36px;
    color: white;
}

.mode-card-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.mode-card-body {
    flex-grow: 1;
    margin-bottom: 20px;
}

.mode-features {
    list-style: none;
    padding: 0;
    margin-bottom: 24px;
}

.mode-features li {
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: flex-start;
}

.mode-price-range {
    background: var(--bg-lighter);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.select-mode-btn {
    margin-top: auto;
}

/* Calculator Card */
.calculator-card {
    background: white !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden;
    border: none !important;
}

.calculator-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    color: white !important;
    padding: 20px 24px !important;
    display: flex !important;
    align-items: center !important;
    border-radius: 0 !important;
}

.calculator-header h4 {
    margin: 0 !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: white !important;
}

.calculator-body {
    padding: 24px !important;
    background: white !important;
}

.calc-section {
    margin-bottom: 0 !important;
}

.calc-section {
    background: #f9fafb;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.calc-section:last-child {
    margin-bottom: 0;
}

.calc-section-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #6b7280 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    margin-bottom: 14px !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calc-section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 2px;
}

#noDiscounts {
    padding: 8px 0 !important;
    text-align: center !important;
    font-size: 13px !important;
}

.calculation-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 12px !important;
    margin: 0 0 6px 0 !important;
    background: white;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.calculation-row:hover {
    background: #f3f4f6;
    transform: translateX(2px);
}

.calculation-row:last-child {
    margin-bottom: 0 !important;
}

.calculation-label {
    font-size: 13px !important;
    color: #4b5563 !important;
    font-weight: 500 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

.calculation-value {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--text-darker) !important;
    margin: 0 !important;
    text-align: right !important;
}

.discount-row .calculation-value,
.bonus-row .calculation-value {
    font-size: 14px !important;
    font-weight: 700 !important;
}

.calculation-total {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 24px !important;
    margin: 0 -16px -16px -16px !important;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    border-radius: 0 0 10px 10px;
}

.total-label {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: white !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dark) !important;
    margin: 0 !important;
}

.total-value {
    font-size: 32px !important;
    font-weight: 800 !important;
    color: white !important;
    margin: 0 !important;
    text-align: right !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.calculation-total-profiles {
    text-align: center !important;
    font-size: 14px !important;
    color: var(--text-muted) !important;
    margin-top: 8px !important;
    margin-bottom: 0 !important;
}

.calculation-savings {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
    padding: 14px 18px !important;
    border-radius: 10px !important;
    text-align: center !important;
    font-size: 14px !important;
    color: #065f46 !important;
    margin-top: 16px !important;
    margin-bottom: 0 !important;
    border: 2px solid #6ee7b7;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.calculation-savings i {
    color: #059669;
}

.calculation-savings strong {
    font-size: 16px;
    color: #047857;
}

.upsell-suggestion {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe) !important;
    padding: 18px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 14px !important;
    margin-top: 16px !important;
    margin-bottom: 0 !important;
    font-size: 13px !important;
    color: #5b21b6 !important;
    border: 2px solid #c4b5fd;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.calculator-footer {
    padding: 20px 24px !important;
    background: var(--bg-lighter) !important;
    border-top: 1px solid var(--border-color) !important;
    border-radius: 0 !important;
    position: relative;
    z-index: 10;
}

.calculator-footer .btn {
    position: relative;
    z-index: 11;
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Duration Selector */
.duration-selector .btn-outline-primary {
    font-size: 14px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border-width: 2px;
    transition: all 0.2s ease;
}

.duration-selector .btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.2);
}

.duration-selector .btn-check:checked + .btn-outline-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.duration-selector .badge {
    font-size: 11px;
    padding: 3px 8px;
    font-weight: 600;
}

/* Tariff Table */
.tariff-table {
    font-size: 13px;
}

.tariff-table th {
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
    padding: 8px;
}

.tariff-table td {
    padding: 8px;
    color: var(--text-muted);
}

.tariff-table .table-success {
    background-color: #f0fdf4;
}

/* Package Cards */
.package-card {
    background: white !important;
    border-radius: 16px !important;
    padding: 20px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
    border: 2px solid transparent !important;
    cursor: pointer !important;
    position: relative !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.package-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
}

.package-card.package-popular {
    border-color: var(--warning-color);
}

.package-card.package-bonus {
    border-color: var(--success-color);
}

.package-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--warning-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.package-badge.bg-success {
    background: var(--success-color);
}

.package-header {
    text-align: center;
    margin-bottom: 16px;
}

.package-header h5 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.package-profiles {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.package-body {
    flex-grow: 1;
    text-align: center;
    margin-bottom: 16px;
}

.package-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.package-unit-price {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.package-equivalent {
    font-size: 12px;
    color: var(--text-lighter);
    padding: 8px 12px;
    background: var(--bg-lighter);
    border-radius: 8px;
    margin-top: 12px;
}

.package-bonus-info {
    font-size: 13px;
    color: var(--success-color);
    font-weight: 600;
    margin-top: 8px;
}

.select-package-btn {
    margin-top: auto;
}

/* Selected Package Info */
.selected-package-details {
    background: var(--bg-lighter);
    padding: 16px;
    border-radius: 12px;
}

.selected-package-details .d-flex {
    font-size: 14px;
}

/* Sticky positioning */
.sticky-top {
    position: sticky;
    top: 20px;
}

/* Contract Create - Form Overrides */
#step2scheduled .card,
#step2automatic .card {
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    overflow: hidden;
    transition: all 0.3s ease;
}

#step2scheduled .card:hover,
#step2automatic .card:hover {
    border-color: #d1d5db !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

#step2scheduled .card-body,
#step2automatic .card-body {
    padding: 24px !important;
}

#step2scheduled .form-control,
#step2automatic .form-control {
    border-radius: 8px !important;
    border: 2px solid #e5e7eb !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
}

#step2scheduled .form-control:focus,
#step2automatic .form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.1) !important;
    transform: translateY(-1px);
}

#step2scheduled .form-control-lg,
#step2automatic .form-control-lg {
    font-size: 20px !important;
    font-weight: 600 !important;
    padding: 16px 20px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%) !important;
}

/* Range Slider */
#step2scheduled .form-range,
#step2automatic .form-range {
    height: 6px;
    cursor: pointer;
}

#step2scheduled .form-range::-webkit-slider-thumb,
#step2automatic .form-range::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

#step2scheduled .form-range::-webkit-slider-thumb:hover,
#step2automatic .form-range::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

#step2scheduled .form-range::-moz-range-thumb,
#step2automatic .form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

#step2scheduled .form-range::-moz-range-thumb:hover,
#step2automatic .form-range::-moz-range-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Form Labels */
#step2scheduled .form-label,
#step2automatic .form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-darker);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#step2scheduled .form-label .fa-info-circle,
#step2automatic .form-label .fa-info-circle {
    font-size: 13px;
    cursor: help;
}

/* Small text improvements */
#step2scheduled small.text-muted,
#step2automatic small.text-muted {
    font-size: 12px;
    color: #6b7280;
}

/* Border top styling */
#step2scheduled .border-top,
#step2automatic .border-top {
    border-color: #e5e7eb !important;
    margin-top: 0 !important;
    padding-top: 16px !important;
}

/* ==================== CONTRACT SCHEDULE PAGE ==================== */

/* Alert Info Box */
.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    border: 2px solid #93c5fd !important;
    border-radius: 12px !important;
    padding: 20px !important;
}

.alert-info h6 {
    color: #1e40af !important;
    font-size: 16px !important;
    margin-bottom: 12px !important;
}

.alert-info p {
    color: #1e3a8a !important;
    margin-bottom: 12px !important;
    line-height: 1.6;
}

.alert-info ul {
    color: #1e3a8a !important;
    margin-bottom: 0 !important;
}

.alert-info ul li {
    margin-bottom: 6px;
}

/* Daily Volume Card */
.card-header.bg-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-bottom: 2px solid #e0e0e0 !important;
    padding: 14px 20px !important;
}

.card-header.bg-light h6 {
    font-size: 15px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    color: #111827 !important;
}

.card-header.bg-light h6 i {
    font-size: 16px !important;
}

/* Daily Profiles Display */
.card-body h3 {
    font-size: 32px !important;
    font-weight: 700 !important;
    margin: 0 !important;
}

.card-body small.d-block {
    font-size: 12px !important;
    color: #6b7280 !important;
    margin-bottom: 4px !important;
}

/* Progress Bar */
.progress {
    height: 10px !important;
    border-radius: 10px !important;
    background-color: #e5e7eb !important;
}

.progress-bar {
    border-radius: 10px !important;
    transition: width 0.4s ease, background-color 0.3s ease;
}

/* Time Slot Cards */
.time-slot-card {
    margin-bottom: 16px !important;
}

.time-slot-card .card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: visible;
}

.time-slot-card .card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.time-slot-card .card-body {
    padding: 20px !important;
}

.time-slot-card .d-flex {
    display: flex !important;
    align-items: flex-start !important;
    gap: 16px !important;
}

.time-slot-card .time-slot-time {
    min-width: 200px;
    flex-shrink: 0;
}

.time-slot-card .time-slot-amount {
    flex: 1;
    min-width: 0;
}

.time-slot-card .time-slot-delete {
    flex-shrink: 0;
}

.time-slot-card .form-label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 8px !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
}

.time-slot-card input[type="time"],
.time-slot-card input[type="number"] {
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    font-size: 16px !important;
    padding: 10px 14px !important;
}

.time-slot-card input[type="time"]:focus,
.time-slot-card input[type="number"]:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.1) !important;
    outline: none !important;
}

.time-slot-card small {
    font-size: 12px !important;
    color: #6b7280 !important;
    display: block;
    margin-top: 6px;
}

.time-slot-card .btn-outline-danger {
    padding: 10px 16px !important;
    border-width: 2px !important;
    transition: all 0.2s ease;
}

.time-slot-card .btn-outline-danger:hover {
    transform: scale(1.05);
}

/* Empty Schedule Message */
#emptyScheduleMessage {
    padding: 60px 20px !important;
}

#emptyScheduleMessage i {
    font-size: 64px !important;
    color: #d1d5db !important;
}

#emptyScheduleMessage p {
    font-size: 15px !important;
    color: #6b7280 !important;
    margin-top: 16px !important;
}

/* Add Time Button */
#addTimeSlotBtn {
    padding: 14px 20px !important;
    font-weight: 600 !important;
    border-width: 2px !important;
    transition: all 0.2s ease;
}

#addTimeSlotBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Auto Distribution Card */
.card.border-primary {
    border-width: 2px !important;
}

.card.border-primary .card-header {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%) !important;
    border-bottom: 2px solid #c4b5fd !important;
}

.card.border-primary .card-body {
    padding: 20px !important;
}

.card.border-primary .card-body p {
    color: #4b5563 !important;
    margin-bottom: 16px !important;
}

.card.border-primary .btn {
    padding: 10px 20px !important;
    font-weight: 600 !important;
    border-width: 2px !important;
    transition: all 0.2s ease;
}

.card.border-primary .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.2);
}

/* Summary Card (Right Side) */
.sticky-top {
    position: sticky !important;
    top: 20px !important;
    align-self: flex-start;
}

.card .card-header.bg-gradient {
    padding: 16px 20px !important;
}

.card .card-header.bg-gradient h6 {
    color: white !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

/* Summary Details */
.card-body small.text-muted {
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #9ca3af !important;
    display: block !important;
    margin-bottom: 12px !important;
}

.card-body .d-flex.justify-content-between {
    padding: 10px 0 !important;
}

.card-body .d-flex.justify-content-between span {
    font-size: 14px !important;
    color: #6b7280 !important;
}

.card-body .d-flex.justify-content-between strong {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #111827 !important;
}

/* Total Section Highlight */
.card-body .d-flex.justify-content-between.align-items-center h5,
.card-body .d-flex.justify-content-between.align-items-center h4 {
    margin: 0 !important;
}

.card-body .d-flex.justify-content-between.align-items-center h5 {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #111827 !important;
}

.card-body .d-flex.justify-content-between.align-items-center h4 {
    font-size: 28px !important;
    font-weight: 800 !important;
    color: var(--primary-color) !important;
}

/* HR Styling */
.card-body hr {
    border-color: #e5e7eb !important;
    margin: 16px 0 !important;
    opacity: 1 !important;
}

/* Payment Button */
#payContractBtn {
    padding: 14px 20px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    transition: all 0.2s ease;
}

#payContractBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

#payContractBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#paymentHint {
    font-size: 13px !important;
}

/* Validation Card */
.card.border-warning {
    border-width: 2px !important;
}

.card.border-warning .card-header {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    border-bottom: 2px solid #fbbf24 !important;
}

.card.border-warning .card-body ul {
    margin: 0 !important;
    padding: 0 !important;
}

.card.border-warning .card-body li {
    list-style: none !important;
    font-size: 14px !important;
    padding: 8px 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card.border-warning .card-body li i {
    font-size: 18px !important;
}

/* Badge Styling */
.badge.bg-secondary {
    font-size: 13px !important;
    padding: 6px 12px !important;
    font-weight: 600 !important;
}

/* General Card Spacing */
.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.card.shadow-sm {
    border: 1px solid #e5e7eb !important;
}

.card.shadow-sm .card-body {
    padding: 24px !important;
}

/* Row Spacing */
.row.g-2 {
    gap: 8px !important;
}

/* Back Button */
.btn-outline-secondary {
    border-width: 2px !important;
    font-weight: 600 !important;
    padding: 10px 20px !important;
}

.btn-outline-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Schedule Container Padding */
#scheduleContainer {
    min-height: 200px;
}

#scheduleContainer .card-footer {
    background: #f9fafb !important;
    border-top: 2px solid #e5e7eb !important;
    padding: 16px 20px !important;
}

/* Fix scrolling for schedule page */
body,
html {
    height: auto !important;
    min-height: 100vh;
}

#app {
    min-height: 100vh;
    height: auto !important;
}

.content-area {
    overflow: visible !important;
}

/* Responsive fixes for time slots */
@media (max-width: 767px) {
    .time-slot-card .d-flex {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .time-slot-card .time-slot-time,
    .time-slot-card .time-slot-amount,
    .time-slot-card .time-slot-delete {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    .time-slot-card .time-slot-delete {
        margin-top: 12px;
    }
    
    .time-slot-card .time-slot-delete .btn {
        width: 100%;
        margin-top: 0 !important;
    }
}

#step2scheduled .form-select,
#step2automatic .form-select {
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    padding: 10px 14px !important;
}

#step2scheduled .form-label,
#step2automatic .form-label {
    margin-bottom: 8px !important;
    color: var(--text-dark) !important;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .mode-card {
        padding: 20px !important;
    }
    
    .mode-icon {
        width: 64px;
        height: 64px;
        font-size: 28px;
    }
    
    .mode-card-header h3 {
        font-size: 20px;
    }
    
    .calculator-card {
        margin-top: 20px;
    }
    
    .sticky-top {
        position: relative;
        top: 0;
    }
    
    .total-value {
        font-size: 24px;
    }
}

@media (max-width: 767px) {
    .mode-features li {
        font-size: 13px;
        padding: 8px 0;
    }
    
    .package-card {
        padding: 16px;
    }
    
    .package-profiles {
        font-size: 24px;
    }
    
    .package-price {
        font-size: 20px;
    }
}


