/* Негізгі стильдер */
:root {
    --primary: #27ae60; /* Жасыл */
    --secondary: #1e8449; /* Қою жасыл */
    --success: #2ecc71; /* Ашық жасыл */
    --danger: #e74c3c; /* Қызыл */
    --warning: #f39c12; /* Сарғыш */
    --light: #ecf0f1; /* Ашық сұр */
    --dark: #34495e; /* Қою сұр */
    --gray: #95a5a6; /* Сұр */
    --background-light: #f0f2f5; /* Ашық фон, iOS стиліне жақын */
    --card-bg: white;
    --shadow-light: 0 4px 12px rgba(0,0,0,0.08); /* Көлеңке күшейтілді */
    --shadow-heavy: 0 8px 25px rgba(0,0,0,0.12); /* Көлеңке күшейтілді */
    --border-radius: 12px; /* Жиектер домалақтандырылды */
}

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

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: var(--background-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, var(--secondary), var(--primary)); /* Жасыл градиент */
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-heavy);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    margin-bottom: 0.8rem;
    font-size: 2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.8rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    transition: background 0.3s ease, transform 0.2s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    z-index: -1;
}

.nav-link:hover::before {
    left: 0;
}

.nav-link.active {
    background: white;
    color: var(--secondary);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex-grow: 1;
}

/* Формалар */
.form-container, .table-wrapper, .search-container, .equipment-list, .chart-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-container:hover, .table-wrapper:hover, .search-container:hover, .equipment-list:hover, .chart-container:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.7rem;
    border-bottom: 2px solid var(--light);
    padding-bottom: 0.75rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap; /* Мобильді үшін қосылды */
}

.form-group {
    flex: 1;
    min-width: 280px; /* Элементтердің кішірейіп кетпеуі үшін */
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fcfcfc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2); /* Жасыл реңк */
    outline: none;
}

/* Кнопкалар */
.btn {
    background: linear-gradient(45deg, var(--primary), var(--success)); /* Жасыл градиент қосылды */
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: inline-block; /* Іздеу формасында дұрыс тұруы үшін */
}

.btn:hover {
    background: linear-gradient(45deg, var(--secondary), #2ecc71); /* Ховер градиент */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: linear-gradient(45deg, var(--gray), #b0bec5);
}

.btn-secondary:hover {
    background: linear-gradient(45deg, #7f8c8d, #95a5a6);
}

.btn-danger {
    background: linear-gradient(45deg, var(--danger), #e06666);
}

.btn-danger:hover {
    background: linear-gradient(45deg, #c0392b, #d9534f);
}

.clear-btn {
    background: #f8f9fa; /* Фон өзгертілді */
    color: var(--dark); /* Текст түсі өзгертілді */
    border: 1px solid #ddd; /* Жиек қосылды */
}

.clear-btn:hover {
    background: #e9ecef;
    color: var(--secondary);
}


/* Кестелер */
.table-wrapper {
    width: 100%;
    overflow-x: auto; /* Кіші экрандарда скролл пайда болады */
    margin-bottom: 2rem;
}

.full-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px; /* Кестенің ең аз ені */
}

th, td {
    padding: 1rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 50;
    text-transform: uppercase;
    font-size: 0.9rem;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #e8f4fc;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

/* Статус белгілері */
.status-active, .status-expired {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    animation: pulse 2s infinite; /* Анимация қосылды */
}

.status-active {
    background: rgba(46, 204, 113, 0.2);
    color: var(--success);
}

.status-expired {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}


/* Техника қосу бөлімі */
#equipment-container {
    margin: 1.5rem 0;
    border: 1px dashed var(--gray);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.equipment-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: center;
    flex-wrap: wrap; /* Мобильді үшін */
}

.equipment-item select,
.equipment-item input {
    flex: 2; /* Select-ке көбірек орын беру */
    min-width: 150px; /* Кіші экрандарда кішіреймеуі үшін */
}

.equipment-item input[type="number"] {
    flex: 1;
    min-width: 100px;
}

.remove-equipment {
    background: var(--danger);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%; /* Дөңгелек батырма */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    transition: background 0.3s ease, transform 0.2s ease;
    flex-shrink: 0; /* Кішіреймеуі үшін */
}

.remove-equipment:hover {
    background: #c0392b;
    transform: rotate(90deg); /* Анимация */
}

/* Техника карточкалары */
.equipment-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.equipment-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    display: flex;
    flex-direction: column; /* Мазмұнды реттеу */
    justify-content: space-between;
    min-height: 150px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.equipment-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.equipment-info h3 {
    margin-bottom: 0.6rem;
    color: var(--secondary);
    font-size: 1.2rem;
}

.equipment-info p {
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 0.4rem;
}

.delete-form {
    margin-top: 1rem;
    text-align: right; /* Батырманы оңға жылжыту */
}

/* Статистика */
.stats-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.stats-controls.full-width {
    justify-content: space-around;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.month-selector select {
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid #ddd;
    background-color: #fcfcfc;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.month-selector select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2); /* Жасыл реңк */
    outline: none;
}

.stats-summary {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%; /* Толық енін алу үшін */
}

.summary-card {
    background: linear-gradient(135deg, #e0f2f7, #c1e0eb); /* Жеңіл градиент */
    padding: 1.2rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    text-align: center;
    min-width: 180px;
    flex: 1; /* Жалпы енін алу үшін */
    min-width: 200px; /* Адаптивтік үшін минималды ені */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--primary);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.summary-card h3 {
    font-size: 1.05rem;
    color: var(--secondary);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.05);
}

/* Диаграмма */
.chart-container {
    margin-top: 2rem;
}

.chart {
    margin-top: 1.5rem;
}

.chart-row {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
}

.chart-label {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark);
}

.chart-bar-container {
    width: 100%;
    height: 35px;
    background: #e0e0e0;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
}

.chart-bar {
    height: 100%;
    background: linear-gradient(90deg, #a0d9b4, var(--primary)); /* Жасыл градиент барға */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.8rem;
    transition: width 0.8s ease-out;
    border-radius: 18px; /* Домалақ жиектер */
}

.chart-bar span {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Хабарламалар */
.no-results {
    text-align: center;
    padding: 2.5rem;
    color: var(--gray);
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    font-size: 1.1rem;
}

/* Мобильді көрініс үшін карточкалар */
.mobile-cards {
    display: none; /* Әдепкі бойынша жасыру */
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.contract-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contract-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    margin: 0;
}

.contract-card p {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    color: var(--dark);
}

.contract-card p strong {
    color: var(--primary);
}

.card-equipments ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

.card-equipments ul li {
    background-color: #e6ffe6; /* Ашық жасыл фон */
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    border: 1px solid #c8f5c8; /* Ашық жасыл жиек */
}

/* Іздеу блогын ортаға қою */
.search-block-center {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.search-container {
    width: 100%;
    max-width: 600px; /* Іздеу блогының максималды ені */
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-light);
    text-align: center;
}

.search-container h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--secondary);
    border-bottom: none;
    padding-bottom: 0;
}

.search-form {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap; /* Мобильді үшін */
    justify-content: center;
}

.search-input {
    flex: 1;
    min-width: 200px; /* Іздеу жолағының минималды ені */
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
    outline: none;
}

.search-btn, .clear-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    flex-shrink: 0; /* Кішіреймеуі үшін */
}

/* Success Message Overlay Styles */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none; /* Фондағы элементтерді басуға мүмкіндік беру */
}

.success-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.success-box {
    background: white;
    padding: 2.5rem 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: var(--success); /* Жасыл түс */
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px var(--success);
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: var(--success);
    fill: none;
    animation: stroke .6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke .3s cubic-bezier(0.65, 0, 0.45, 1) .8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 52px var(--success);
    }
}

@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

.success-box p {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0;
}


/* Адаптивтік */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    nav {
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .container {
        padding: 0 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0; /* Кіші экрандарда аралықты азайту */
    }
    
    .form-group {
        min-width: 100%; /* Толық енін алу */
        margin-bottom: 0.8rem;
    }

    .form-container, .table-wrapper, .search-container, .equipment-list, .chart-container {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    h2 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .btn {
        width: 100%; /* Батырмалар толық енді болады */
        margin-top: 0.5rem;
        font-size: 0.95rem;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        margin-bottom: 0.8rem;
    }
    .search-btn {
        margin-bottom: 0.5rem;
    }
    .clear-btn {
        margin-top: 0; /* Батырмалар арасындағы аралықты реттеу */
    }

    /* Кестені жасырып, карточкаларды көрсету */
    .table-wrapper {
        display: none;
    }
    .mobile-cards {
        display: flex; /* Мобильді көріністе көрсету */
    }

    .stats-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .stats-summary {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .summary-card {
        min-width: unset;
        width: 100%; /* Толық енін алады */
        padding: 1rem;
    }

    .summary-card h3 {
        font-size: 0.9rem;
    }
    .summary-card p {
        font-size: 1.5rem;
    }

    .equipment-item {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    .equipment-item select,
    .equipment-item input,
    .remove-equipment {
        width: 100%;
        min-width: unset;
    }
    .remove-equipment {
        height: 40px;
        border-radius: 6px; /* Дөңгелек емес */
    }
}
/* style.css файлына қосу */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 10px 0;
    color: #333;
}

.chart-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    flex: 1;
    min-width: 300px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: 400px;
}

.chart-container h3 {
    margin-top: 0;
    text-align: center;
}

.error-message {
    color: #f44336;
    margin-top: 5px;
}

.logout-btn-container {
    text-align: center;
    margin-top: 20px;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
}
<style>
    /* ... (сіздің басқа стильдеріңіз) ... */

    /* "ЖОЮ" батырмасына арналған стильдер */
    .nav-link-danger {
        background-color: #dc3545; /* Қызыл фон */
        color: #fff; /* Ақ мәтін */
        padding: 10px 15px; /* Ішкі шегініс */
        border-radius: 5px; /* Жұмырланған жиектер */
        text-decoration: none; /* Асты сызылмайды */
        font-weight: 500; /* Қалың шрифт */
        transition: background-color 0.3s ease, transform 0.2s ease; /* Анимацияға арналған ауысу эффектісі */
        margin-left: 20px; /* Басқа сілтемелерден шегініс */
    }

    .nav-link-danger:hover {
        background-color: #c82333; /* Тінтуірді апарғанда ашық қызыл түс */
        transform: scale(1.05); /* Көлемі аздап ұлғаяды */
    }
    
    /* ... (басқа стильдеріңіз) ... */
</style>