html {
    font-size: 80%;
}

:root {
    --primary: #2dd4bf;
    --primary-dark: #14b8a6;
    --primary-light: #5eead4;
    --bg-primary: #020617;
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    --border: #1e293b;
    --border-light: #334155;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 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);
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --gradient-bg: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* Navigation */
.navbar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    position: relative;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-bg);
    opacity: 0.5;
    z-index: -1;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 1.5rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-brand img {
    width: 40px;
    height: 40px;
}

.brand-logo {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    text-align: left;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.nav-item.active {
    box-shadow: inset 3px 0 0 0 var(--primary);
}

.nav-item:hover {
    transform: translateX(4px);
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-item span {
    font-weight: 500;
}

.nav-profile {
    padding: 0 2rem;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-switcher select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.4rem 0.75rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.language-switcher select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text-primary);
}

.profile-info span {
    font-weight: 500;
}

.profile-info button {
    align-self: flex-start;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
    position: relative;
}

.main-content::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 58%; /* Adjusted for sidebar */
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background-image: url('biglogo.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

.main-content::after {
    content: '';
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    background-image: url('logo.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    opacity: 0.1;
    pointer-events: none;
    z-index: 100;
    border-radius: 50%;
    background-color: rgba(45, 212, 191, 0.05);
}

.page {
    display: none;
    padding: 2rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    height: 100%;
    overflow-y: auto;
}

.page.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: 500px;
    margin-bottom: 6rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.accent {
    color: var(--primary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.6;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-4px);
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.stat-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    font-size: 1.75rem;
    color: var(--primary);
}

.stat-info h3 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 400px;
}

.floating-card {
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: var(--shadow-xl);
    animation: float 6s ease-in-out infinite;
}

.cycle-stats .stat-card:nth-child(1) .stat-icon { color: var(--primary); }
.cycle-stats .stat-card:nth-child(2) .stat-icon { color: var(--warning); }
.cycle-stats .stat-card:nth-child(3) .stat-icon { color: var(--success); }

.floating-card:nth-child(2) {
    top: 60%;
    right: 20%;
    animation-delay: -2s;
}

.floating-card:nth-child(3) {
    top: 10%;
    right: 10%;
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(5deg);
    }
    66% {
        transform: translateY(10px) rotate(-5deg);
    }
}

/* Features Section */
.features-section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
    transition: left 0.5s ease;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-8px);
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.feature-arrow {
    color: var(--primary);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-arrow {
    transform: translateX(8px);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-title i {
    color: var(--primary);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

/* Logs Page */
.logs-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.week-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.week-group.no-date-group {
    background: var(--bg-primary);
}

.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.week-header.collapsible {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    padding: 0.5rem;
    margin: -0.5rem -0.5rem 0.25rem -0.5rem;
}

.week-header.collapsible:hover {
    background: rgba(148, 163, 184, 0.05);
}

.week-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
}

.week-toggle:hover {
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.1);
}

.week-toggle i {
    transition: transform 0.2s ease;
}

.week-group.collapsed .week-days {
    display: none;
}

.week-group.collapsed .week-header {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0.5rem;
}

.week-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.week-range {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.week-days {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.day-group {
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px dashed rgba(16, 185, 129, 0.25);
}

.day-group.no-date-day {
    border-left: none;
    padding-left: 0;
}

.day-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.day-group:not(.no-date-day) .day-header::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    display: inline-block;
}

.day-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.day-cycles {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-left: 0.25rem;
}

.day-group.no-date-day .day-cycles {
    margin-left: 0;
}

.day-cycles .log-entry {
    margin-bottom: 0;
}

.log-entry {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.log-entry:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.log-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.log-status {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.log-status.completed,
.log-status.success {
    background: rgba(45, 212, 191, 0.18);
    color: var(--primary);
}

.log-status.in-progress,
.log-status.active {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}

.log-status.failed,
.log-status.error {
    background: rgba(239, 68, 68, 0.18);
    color: var(--danger);
}

.log-status.cancelled,
.log-status.inactive {
    background: rgba(107, 114, 128, 0.18);
    color: #9ca3af;
}

.log-status.paused,
.log-status.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.log-info {
    flex: 1;
}

.log-info h3 {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.log-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.log-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.log-time {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.log-profit {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    background: rgba(45, 212, 191, 0.12);
    border: 1px solid rgba(45, 212, 191, 0.25);
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.08);
    align-self: flex-start;
}

.log-profit .profit-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.log-profit .profit-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.log-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.log-actions .status-badge {
    margin-right: 0.25rem;
}

.log-timeline {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.75rem;
}

.timing-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    min-width: 0;
}

.timing-block::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0.6;
}

.timing-block.start {
    border-color: rgba(45, 212, 191, 0.35);
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.2);
}

.timing-block.end {
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.timing-block.ongoing {
    border-style: dashed;
    border-color: rgba(59, 130, 246, 0.35);
}

.timing-block.missing {
    border-style: dashed;
    border-color: rgba(148, 163, 184, 0.25);
}

.timing-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.timing-day {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.04em;
}

.timing-date,
.timing-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.timing-placeholder {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.timing-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.timing-connector i {
    padding: 0.5rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.log-details p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.log-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.log-details {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}

/* Cycle Clients Section */
.cycle-clients-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(16, 185, 129, 0.2);
}

.cycle-clients-section h4 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cycle-clients-section.empty {
    text-align: center;
    padding: 20px;
}

.cycle-clients-section .empty-message {
    color: var(--text-muted);
    font-style: italic;
}

.clients-table-container {
    overflow-x: auto;
    margin-top: 10px;
}

.clients-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    overflow: hidden;
}

.clients-table thead {
    background: rgba(16, 185, 129, 0.15);
}

.clients-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--accent-color);
    border-bottom: 2px solid rgba(16, 185, 129, 0.3);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clients-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.clients-table tbody tr:hover {
    background: rgba(16, 185, 129, 0.08);
}

.clients-table tbody tr:last-child td {
    border-bottom: none;
}

.clients-table tfoot {
    background: rgba(16, 185, 129, 0.1);
    font-weight: 600;
}

.clients-table tfoot td {
    padding: 12px 10px;
    border-top: 2px solid rgba(16, 185, 129, 0.3);
    border-bottom: none;
}

.clients-table .profit-net {
    color: var(--accent-color);
    font-weight: 700;
}

.clients-table .totals-row {
    background: rgba(16, 185, 129, 0.12);
}

.clients-table small {
    color: var(--text-muted);
    font-size: 12px;
}

/* Manage Clients Modal */
.manage-clients-modal {
    max-width: 1600px !important;
    width: 95% !important;
    max-height: 95vh !important;
    overflow: auto;
}

.manage-clients-modal .modal-body {
    max-height: calc(95vh - 200px);
    overflow-y: auto;
    padding: 2rem;
}

.manage-clients-modal .modal-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
}

.manage-clients-modal .modal-header {
    padding: 2rem 2.5rem;
}

.cycle-info-bar {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--accent-color);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cycle-info-bar strong {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.cycle-info-bar .status-badge {
    padding: 6px 16px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    background: var(--accent-color);
    color: white;
}

.clients-manager {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.add-client-section h4,
.current-clients-section h4 {
    color: var(--accent-color);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.add-client-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.add-client-form select {
    flex: 1;
    font-size: 1.1rem;
    padding: 1rem 1.25rem;
    min-height: 52px;
}

.add-client-form button {
    flex-shrink: 0;
    font-size: 1.15rem;
    padding: 15px 30px;
}

.clients-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.client-item {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.client-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
    transform: translateY(-2px);
}

.client-item-header {
    background: rgba(16, 185, 129, 0.08);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.client-name {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.client-name i {
    color: var(--accent-color);
    font-size: 1.35rem;
}

.client-name strong {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
}

.client-company {
    color: var(--text-muted);
    font-size: 1rem;
    margin-left: 10px;
}

.quotation-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 6px;
}

.quotation-badge i {
    font-size: 0.85rem;
}

.client-item-body {
    padding: 20px;
}

.client-item-body .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}

.client-item-body .form-control {
    font-size: 1.05rem;
    padding: 12px 16px;
    min-height: 48px;
}

.client-item-body label {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-style: italic;
    font-size: 1.1rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.btn-icon.btn-danger:hover {
    background: #ef4444;
    color: white;
}

.log-attachments {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(16, 185, 129, 0.3);
}

.log-attachments h4 {
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.attachment-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.attachment-item {
    flex: 1;
    min-width: 150px;
}

    .cycle-image-preview {
        position: relative;
        border-radius: 10px;
        overflow: hidden;
        background: rgba(16, 185, 129, 0.12);
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 160px;
    }

    .cycle-image-preview img {
        width: 100%;
        height: auto;
        display: block;
        object-fit: cover;
    }

    .cycle-image-fallback {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 1rem;
        color: var(--text-muted);
        text-align: center;
    }

    .cycle-image-fallback i {
        font-size: 1.5rem;
    }

    .attachment-item.attachment-image {
        flex: 1 1 320px;
        min-width: 260px;
    }

    .attachment-meta {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-top: 0.75rem;
    }

    .attachment-meta span {
        color: var(--text-secondary);
        font-size: 0.9rem;
        font-weight: 500;
    }

    .attachment-buttons {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .cycle-chart {
        margin-top: 1.25rem;
        padding: 1rem 1.25rem;
        border: 1px dashed rgba(148, 163, 184, 0.4);
        border-radius: 14px;
        background: rgba(15, 23, 42, 0.6);
        position: relative;
    }

    .cycle-chart canvas {
        width: 100% !important;
        max-width: 100%;
        height: 320px !important;
        cursor: pointer;
        transition: opacity 0.2s ease;
    }

    .cycle-chart canvas:hover {
        opacity: 0.8;
    }

    .cycle-chart .chart-status {
        text-align: center;
        color: var(--text-muted);
        font-size: 0.9rem;
        margin: 0.5rem 0 0;
    }

    .cycle-chart .chart-status.error {
        color: #f97316;
    }

    .cycle-chart .chart-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
    }

    .cycle-chart .chart-title {
        color: var(--text-muted);
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .cycle-chart .chart-title i {
        color: var(--accent-color);
    }

    .live-indicator {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        background: rgba(16, 185, 129, 0.15);
        color: #10b981;
        padding: 0.25rem 0.75rem;
        border-radius: 999px;
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.05em;
        border: 1px solid rgba(16, 185, 129, 0.3);
    }

    .live-dot {
        width: 8px;
        height: 8px;
        background: #10b981;
        border-radius: 50%;
        animation: livePulse 1.5s ease-in-out infinite;
    }

    @keyframes livePulse {
        0%, 100% {
            opacity: 1;
            transform: scale(1);
            box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
        }
        50% {
            opacity: 0.7;
            transform: scale(1.1);
            box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
        }
    }

.btn-attachment {
    width: 100%;
    padding: 8px 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-attachment:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.attachment-download {
    width: auto;
    white-space: nowrap;
}

/* Data Logs Page */
.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    width: 300px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.data-table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.data-table tr:hover {
    background: var(--bg-tertiary);
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.info {
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary);
}

.badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary);
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.success {
    background: var(--primary);
}

.status-dot.warning {
    background: #f59e0b;
}

.status-dot.error {
    background: #ef4444;
}

/* Todo Page */
.todo-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.todo-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.todo-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.todo-stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.todo-stat .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.todo-stat .stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.todo-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.todo-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.todo-item.completed {
    opacity: 0.6;
}

.todo-item.completed .todo-content h3,
.todo-item.completed .todo-content p {
    text-decoration: line-through;
}

.todo-checkbox {
    position: relative;
}

.todo-checkbox input[type="checkbox"] {
    display: none;
}

.todo-checkbox label {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: block;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.todo-checkbox input[type="checkbox"]:checked + label {
    background: var(--primary);
    border-color: var(--primary);
}

.todo-checkbox input[type="checkbox"]:checked + label::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.todo-content {
    flex: 1;
}

.todo-content h3 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.todo-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.todo-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.priority {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority.high {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.priority.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.priority.low {
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary);
}

.due-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.todo-actions {
    display: flex;
    gap: 8px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        height: auto;
    }
    
    .navbar {
        width: 100%;
        flex-direction: row;
        padding: 1rem;
        height: auto;
    }
    
    .nav-menu {
        flex-direction: row;
        padding: 0;
        gap: 1rem;
    }
    
    .nav-item {
        padding: 0.75rem 1rem;
        white-space: nowrap;
    }
    
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .page {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .todo-stats {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-input {
        width: 100%;
    }
    
    .data-table-container {
        overflow-x: auto;
    }
    
    .todo-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .todo-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .log-title-row {
        flex-direction: column;
        align-items: stretch;
    }

    .log-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .log-profit {
        width: 100%;
    }

    .log-timeline {
        flex-direction: column;
    }

    .timing-connector {
        display: none;
    }
}

/* Login Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease-in-out;
}

.modal-overlay .modal {
    /* Reset properties from global .modal (overlay) so this acts as the dialog box */
    position: relative;
    top: auto;
    left: auto;
    width: min(640px, calc(100vw - 80px));
    max-width: 95vw;
    height: auto;
    max-height: 90vh;
    margin: 0 auto;

    /* Dialog visuals */
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-in-out;
    overflow: visible;
    box-shadow: var(--shadow-xl);
}

.modal-overlay .modal.login-modal {
    width: min(520px, calc(100vw - 80px));
    max-width: 520px;
}

.modal-overlay .modal.login-modal .modal-body {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}

/* Cycle modal in overlay */
.modal-overlay .modal.cycle-modal {
    width: min(780px, calc(100vw - 80px));
    max-width: 780px;
}

/* Manage clients modal in overlay */
.modal-overlay .modal.manage-clients-modal {
    width: min(1400px, calc(100vw - 80px));
    max-width: 1400px;
}

/* Warehouse modal in overlay */
.modal-overlay.warehouse-modal .modal {
    width: min(820px, calc(100vw - 80px));
    max-width: 820px;
}

/* Calendar modal in overlay */
.modal-overlay.calendar-modal .modal {
    max-width: 1400px;
    width: 95%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
    /* Give room for the scrollbar so content doesn't look cramped */
    padding-right: calc(2rem + 10px);
    overflow-y: auto;
    flex: 1;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-footer {
    display: flex;
    gap: 1.5rem;
    padding: 2rem 2.5rem;
    border-top: 2px solid var(--border);
    justify-content: flex-end;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.manage-clients-modal .modal-footer button {
    font-size: 1.15rem;
    padding: 15px 30px;
}

/* Cycle modal specific styles */
.cycle-modal .modal {
    max-width: 600px;
    width: 95%;
}

/* Mobile responsive modal */
@media (max-height: 700px) {
    .modal {
        max-height: 95vh;
        margin: 2.5vh auto;
    }
    
    .modal-overlay .modal {
        max-height: 90vh;
    }
}

@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-width: none;
        margin: 20px auto;
        max-height: calc(100vh - 40px);
    }
    
    .cycle-modal .modal {
        width: 95%;
        max-width: none;
    }
    
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-overlay .modal {
        width: 95%;
        max-height: 95vh;
    }
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 2px solid var(--border);
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-secondary:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    animation: slideInRight 0.3s ease-in-out;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.notification.success {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
}

.notification.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.notification i {
    color: var(--primary);
}

.notification.error i {
    color: #ef4444;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: auto;
    padding: 0;
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: var(--text-primary);
}

/* Log entries */
.log-entry {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.log-entry:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.log-header h3 {
    color: var(--text-primary);
    margin: 0;
}

.log-time {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.log-content p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.log-content strong {
    color: var(--text-primary);
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status.completed,
.status.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary);
}

.status.pending,
.status.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.status.error,
.status.failed {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.log-level {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.log-level.info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.log-level.warn {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.log-level.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes completeTask {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.empty-state p {
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.empty-row {
    border: none !important;
}

.empty-row td {
    border: none !important;
    padding: 0 !important;
}

/* Cycle stats */
.cycle-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Role and status badges */
.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.admin {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.role-badge.manager {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.role-badge.user {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active,
.status-badge.in-progress {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}

.status-badge.completed {
    background: rgba(45, 212, 191, 0.18);
    color: var(--primary);
}

.status-badge.failed,
.status-badge.error {
    background: rgba(239, 68, 68, 0.18);
    color: var(--danger);
}

.status-badge.cancelled,
.status-badge.inactive {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.status-badge.paused,
.status-badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.btn-icon.danger {
    color: #ef4444;
}

.btn-icon.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Warehouse page */
.warehouse-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.warehouse-search-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    min-width: 280px;
}

.warehouse-search-group input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
}

.warehouse-search-group input:focus {
    outline: none;
}

.warehouse-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.warehouse-toggle input {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.warehouse-stats {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
}

.warehouse-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow);
}

.warehouse-stat-card .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.warehouse-stat-card strong {
    font-size: 1.75rem;
    color: var(--text-primary);
}

.warehouse-stat-card.danger {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(239, 68, 68, 0.12);
}

.warehouse-columns {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 2rem;
}

.warehouse-column {
    background: var(--bg-secondary);
    border-radius: 18px;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.warehouse-column-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.warehouse-column-header.chemical {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.15));
}

.warehouse-column-header.thermal {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(234, 88, 12, 0.15));
}

.warehouse-column-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.warehouse-order-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.warehouse-order-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.warehouse-order-card.overdue {
    border-color: rgba(248, 113, 113, 0.45);
    box-shadow: 0 10px 20px -15px rgba(248, 113, 113, 0.7);
}

.warehouse-order-card.inactive {
    opacity: 0.7;
}

.order-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.order-card-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.order-card-summary .btn-icon {
    flex-shrink: 0;
}

.order-toggle {
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.order-toggle:hover {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.12);
    transform: translateY(-1px);
}

.order-summary-main {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.order-summary-title h3 {
    margin: 0;
    font-size: 1.1rem;
}

.order-summary-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.order-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.order-summary-meta .meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 120px;
}

.order-summary-meta .meta-item .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.order-summary-meta .meta-item strong {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.order-summary-meta .meta-item .hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.order-summary-meta .meta-item .hint.overdue {
    color: #fca5a5;
}

.order-summary-meta .status-pill .order-status-badge {
    margin-top: 0.2rem;
}

.order-summary-quantity {
    min-width: 120px;
    text-align: center;
}

.order-summary-quantity .label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.order-summary-quantity strong {
    display: block;
    font-size: 1rem;
    color: var(--text-primary);
}

.order-summary-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
}

.order-summary-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-summary-actions .btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.warehouse-order-card.expanded {
    border-color: var(--primary);
}

.warehouse-order-card.expanded .order-toggle {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.15);
}

.order-details {
    width: 100%;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    margin-top: 1rem;
    padding-top: 1rem;
}

.order-details[hidden] {
    display: none !important;
}

.order-detail-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 1024px) {
    .order-card-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .order-summary-controls {
        width: 100%;
        justify-content: space-between;
    }

    .order-summary-quantity {
        width: 100%;
        text-align: left;
    }
}

@media (max-width: 640px) {
    .order-summary-meta {
        flex-direction: column;
    }

    .order-status-control {
        width: 100%;
    }

    .order-summary-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

.order-card-title h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.order-company {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.order-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.order-reference {
    background: rgba(15, 23, 42, 0.45);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.order-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.order-status-badge.status-pending {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

.order-status-badge.status-in-progress {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

.order-status-badge.status-ready {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
}

.order-status-badge.status-completed {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.order-status-badge.status-cancelled {
    background: rgba(248, 113, 113, 0.2);
    color: #fca5a5;
}

.order-card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-description {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
}

.order-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.order-details-grid .label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.order-details-grid strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.order-details-grid .hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.order-details-grid .hint.overdue {
    color: #fca5a5;
}

.order-contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-contact-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
}

.order-contact-links .muted,
.muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.order-notes {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px dashed var(--border-light);
}

.order-notes span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.order-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.order-creator {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.order-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.order-actions .btn-secondary,
.order-actions .btn-primary,
.order-actions .btn-icon {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
}

.order-actions .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.order-actions .btn-secondary.loading,
.order-actions .btn-primary.loading,
.order-actions .btn-icon.loading {
    opacity: 0.65;
    pointer-events: none;
}

.order-status-control {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 160px;
}

.order-status-control span {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.order-status-control select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 0.55rem 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.order-status-control select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.page-subtitle {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.warehouse-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 1rem;
}

.warehouse-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.warehouse-form .form-group label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    display: block;
}

.warehouse-form .form-group input,
.warehouse-form .form-group select,
.warehouse-form .form-group textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.quantity-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    width: 100%;
}

.quantity-input-group input {
    flex: 2;
    min-width: 120px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quantity-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    background: var(--bg-secondary);
}

.quantity-input-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.quantity-input-group select {
    flex: 1;
    min-width: 80px;
    max-width: 100px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quantity-input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    background: var(--bg-secondary);
}

/* Updated warehouse order card styles */
.warehouse-order-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.warehouse-order-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.warehouse-order-card.overdue {
    border-color: rgba(248, 113, 113, 0.45);
    box-shadow: 0 10px 20px -15px rgba(248, 113, 113, 0.7);
}

.warehouse-order-card.expanded {
    border-color: var(--primary);
}

.order-card-summary {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
}

.order-toggle {
    flex-shrink: 0;
    margin-top: 0.25rem;
    transition: transform 0.2s ease;
}

.order-toggle i {
    transition: transform 0.2s ease;
}

.order-summary-main {
    flex: 1;
    min-width: 0;
}

.order-summary-title h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    line-height: 1.2;
}

.order-summary-subtitle {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.order-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.meta-item .label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-item strong {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.meta-item .hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.meta-item .hint.overdue {
    color: #fca5a5;
}

.meta-item.status-pill {
    align-items: flex-start;
}

.order-summary-quantity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.4rem 0.6rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    min-width: 65px;
    text-align: center;
}

.order-summary-quantity .label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.order-summary-quantity strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
}

.order-summary-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
}

.order-summary-actions {
    display: flex;
    gap: 0.5rem;
}

.order-details {
    border-top: 1px solid var(--border);
    animation: slideDown 0.3s ease-out;
}

.order-details[hidden] {
    display: none;
}

.order-card-body {
    padding: 1.25rem 1.5rem;
}

.order-description {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.order-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.order-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(148, 163, 184, 0.05);
    border-top: 1px solid var(--border-light);
}

.order-creator {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.order-detail-actions {
    display: flex;
    gap: 0.75rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.quantity-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-input-group input {
    flex: 1;
}

.quantity-input-group select {
    min-width: 90px;
}

.warehouse-form .form-group input:focus,
.warehouse-form .form-group select:focus,
.warehouse-form .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.warehouse-form .required {
    color: #f87171;
    margin-left: 0.25rem;
}

@media (max-width: 1024px) {
    .warehouse-columns {
        grid-template-columns: 1fr;
    }

    .warehouse-actions {
        justify-content: flex-start;
    }
}

/* Chart Modal Styles */
.chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.chart-modal.active {
    opacity: 1;
    visibility: visible;
}

.chart-modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    max-width: 95vw;
    max-height: 95vh;
    width: 1200px;
    position: relative;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
}

.chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.chart-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chart-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.chart-modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.chart-modal-body {
    position: relative;
}

.chart-modal-canvas {
    width: 100% !important;
    height: 600px !important;
    max-width: 100%;
}

/* Admin Dashboard Styles */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-stats .stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.dashboard-stats .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quick-actions {
    margin-bottom: 2rem;
}

.quick-actions h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.recent-activity {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.recent-activity h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    background: var(--primary);
}

.activity-content {
    flex: 1;
}

.activity-message {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Modal Styles */
.modal {
    /* Overlay container for page-level modals (e.g., admin.html) */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none; /* hidden by default; shown via JS or more specific rules */
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border);
    max-width: 1200px;
    width: 92%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    margin: 0 auto;
    position: relative;
}

/* Custom scrollbar for modals */
.modal-content::-webkit-scrollbar {
    width: 12px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 0 16px 16px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
    border: 2px solid var(--bg-tertiary);
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 2.5rem;
    border-bottom: 2px solid var(--border);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.modal-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header h2 i {
    color: var(--primary);
    font-size: 1.5rem;
}

.modal-large .modal-header h2 {
    font-size: 1.9rem;
    font-weight: 700;
}

.modal-large .modal-header h2 i {
    font-size: 1.75rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: rotate(90deg);
}

.modal form {
    padding: 2.5rem;
    /* Keep form content nicely centered inside wider dialogs */
    max-width: 720px;
    margin: 0 auto;
}

.modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.modal .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    overflow: hidden;
}

.modal .form-group label {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    padding: 1rem 1.25rem;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1.05rem;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.modal .form-group input,
.modal .form-group select {
    min-height: 48px;
}

.modal .form-group textarea {
    resize: vertical;
    min-height: 120px;
    max-height: 200px;
    font-family: inherit;
    overflow-y: auto;
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.modal .form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.modal .form-group label:has(input[type="checkbox"]) {
    flex-direction: row;
    align-items: center;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 2rem 2.5rem;
    border-top: 2px solid var(--border);
    background: var(--bg-tertiary);
}

/* Specific Modal Styles */
#cycle-modal {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#cycle-modal .modal-content {
    max-width: 800px;
    width: 90%;
}

/* Quotations modal visibility is controlled by JS; no display override here */

#quotations-modal .modal-content {
    max-width: 1800px;
    width: 96%;
}

/* Profit Calculator Styles */
.profit-breakdown {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1.5rem;
}

.profit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    font-size: 1.1rem;
}

.profit-item:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.profit-item.total {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--primary);
    border-top: 2px solid var(--border);
    margin-top: 0.75rem;
    padding-top: 1.25rem;
}

.profit-item span:first-child {
    color: var(--text-secondary);
    font-weight: 500;
}

.profit-item span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

.profit-item.total span {
    color: var(--primary);
}

/* Client Management Styles */
.clients-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.client-pricing {
    font-size: 1rem;
    color: var(--text-secondary);
}

.client-pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.5rem;
}

#client-modal .client-pricing {
    font-size: 1.1rem;
}

#client-modal .client-pricing-grid {
    gap: 0.75rem 2rem;
}

.client-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon-sm {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-icon-sm:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-icon-sm.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-profit {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-profit:hover {
    background: var(--primary-dark);
}

.btn-quotations {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-quotations:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
}

/* Quotations Manager Modal: styles applied via .modal-large on modal-content */

.modal-content.modal-large {
    max-width: 1800px !important;
    width: 96% !important;
    max-height: 96vh !important;
}

/* Client and Profit modals - visibility controlled by JS; no display override */

#client-modal .modal-content,
#profit-modal .modal-content {
    max-width: 1400px !important;
    width: 95% !important;
}

#client-modal .modal-header h2,
#profit-modal .modal-header h2 {
    font-size: 2rem;
}

#client-modal .form-group label,
#profit-modal .form-group label {
    font-size: 1.15rem;
    font-weight: 600;
}

#client-modal .form-group input,
#client-modal .form-group select,
#client-modal .form-group textarea,
#profit-modal .form-group input,
#profit-modal .form-group select {
    font-size: 1.1rem;
    padding: 1.1rem 1.3rem;
    min-height: 52px;
}

#client-modal .btn-primary,
#client-modal .btn-secondary,
#profit-modal .btn-primary,
#profit-modal .btn-secondary {
    font-size: 1.15rem;
    padding: 15px 30px;
}

#profit-modal h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

#profit-modal .profit-breakdown {
    margin-top: 2rem;
}

#profit-modal .profit-item {
    font-size: 1.2rem;
    padding: 1.2rem 0;
}

#profit-modal .profit-item.total {
    font-size: 1.5rem;
}

.quotations-manager {
    display: grid;
    grid-template-columns: 650px 1fr;
    gap: 35px;
    padding: 25px 0;
    min-height: 700px;
}

.quotation-add-section,
.quotations-list-section {
    background: var(--card-bg);
    padding: 35px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow-y: auto;
    max-height: 78vh;
}

.quotation-add-section h3,
.quotations-list-section h3 {
    margin: 0 0 30px 0;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    position: sticky;
    top: 0;
    background: var(--card-bg);
    padding-bottom: 18px;
    border-bottom: 3px solid var(--border-color);
    z-index: 10;
}

.quotation-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 28px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    overflow: hidden;
    word-wrap: break-word;
}

.quotation-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
    transform: translateY(-3px);
    background: var(--bg-tertiary);
}

.quotation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--border-color);
}

.quotation-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.quotation-card-title i {
    color: var(--primary);
    font-size: 1.3rem;
}

.quotation-card-title i {
    color: var(--primary);
}

.quotation-card-actions {
    display: flex;
    gap: 8px;
}

.quotation-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.quotation-price-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.quotation-price-item strong {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.quotation-discount {
    background: var(--success-bg);
    color: var(--success);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    display: inline-block;
    margin-top: 14px;
}

.quotation-add-section .form-group label {
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    color: var(--text-color);
}

.quotation-add-section .form-group input,
.quotation-add-section .form-group textarea {
    font-size: 1.15rem;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    min-height: 50px;
    width: 100%;
    box-sizing: border-box;
}

.quotation-add-section .form-group textarea {
    resize: vertical;
    max-height: 150px;
    overflow-y: auto;
}

.quotation-add-section .form-group input:focus,
.quotation-add-section .form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.quotation-add-section .form-group small {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 6px;
    display: block;
}

.quotation-add-section h4 {
    font-size: 1.3rem;
    margin: 35px 0 20px 0;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-radius: 10px;
    border-left: 5px solid var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quotation-add-section small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 6px;
    font-style: italic;
}

/* Special button styles for quotations modal */
.quotation-add-section .modal-actions button,
.quotations-list-section .modal-actions button {
    padding: 16px 32px;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 12px;
    gap: 12px;
}

.quotation-add-section .btn-primary,
#add-quotation-form .btn-primary {
    min-width: 180px;
}

.quotation-card-actions button {
    padding: 10px 16px;
    font-size: 1rem;
    border-radius: 8px;
}

/* Form rows in quotations modal */
.quotation-add-section .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.quotation-add-section .form-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.quotations-list-section {
    position: relative;
}

#quotations-list:empty::before {
    content: 'Brak wycen. Dodaj pierwszą wycenę używając formularza po lewej stronie.';
    display: block;
    text-align: center;
    color: var(--text-secondary);
    padding: 60px 30px;
    font-size: 1.15rem;
    line-height: 1.6;
}

/* Scrollbar styling for quotations sections */
.quotation-add-section::-webkit-scrollbar,
.quotations-list-section::-webkit-scrollbar {
    width: 10px;
}

.quotation-add-section::-webkit-scrollbar-track,
.quotations-list-section::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 10px;
}

.quotation-add-section::-webkit-scrollbar-thumb,
.quotations-list-section::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.quotation-add-section::-webkit-scrollbar-thumb:hover,
.quotations-list-section::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .modal-large {
        max-width: 95% !important;
    }
    
    .modal-content.modal-large {
        width: 95% !important;
    }
    
    .quotations-manager {
        grid-template-columns: 500px 1fr;
    }
    
    #quotations-modal .modal-content {
        width: 95%;
    }
}

@media (max-width: 1200px) {
    .quotations-manager {
        grid-template-columns: 450px 1fr;
    }
}

@media (max-width: 968px) {
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
    }
    
    .modal .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal form {
        padding: 1.5rem;
    }
    
    .modal-header {
        padding: 1.5rem;
    }
    
    .modal-actions {
        padding: 1.5rem;
    }
    
    .client-pricing-grid {
        grid-template-columns: 1fr;
    }

    .quotations-manager {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .quotation-add-section,
    .quotations-list-section {
        max-height: none;
    }
    
    .quotation-add-section .form-row {
        grid-template-columns: 1fr;
    }

    .quotation-card-body {
        grid-template-columns: 1fr;
    }
    
    /* Specific modals responsive */
    #cycle-modal .modal-content,
    #quotations-modal .modal-content,
    #client-modal .modal-content,
    #profit-modal .modal-content {
        width: 95%;
        max-width: 95%;
    }
    
    .manage-clients-modal {
        width: 95% !important;
    }
    
    .modal-overlay.warehouse-modal .modal,
    .modal-overlay.calendar-modal .modal {
        width: 95%;
        max-width: 95%;
    }
}

/* ========================================
   PLC SETTINGS STYLES
   ======================================== */

.plc-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.plc-connections-section,
.plc-data-history-section,
.plc-status-overview {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.plc-connections-section h3,
.plc-data-history-section h3,
.plc-status-overview h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 1.3em;
}

#plc-modal .modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type='checkbox'] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    font-weight: 500;
}

code {
    background: var(--background-color, #f5f5f5);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-error {
    background: var(--danger);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-secondary {
    background: var(--text-secondary);
    color: white;
}

.badge i {
    margin-right: 4px;
}



.plc-health-widget {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

.plc-health-widget h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 1.3em;
}

