/* assets/css/style.css */
/* Адаптивний дизайн для системи оплати послуг */

:root {
    --primary-color: #627ef5;
    --primary-hover: #5974e4;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --bg-color: #F9FAFB;
    --sidebar-bg: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* === СТОРІНКА ВХОДУ === */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}

.login-box h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* === ОСНОВНИЙ LAYOUT === */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 20px;
    color: #000;
    margin-bottom: 5px;
    font-weight: 400;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0px;
    background: #CED4D8 url(../img/nopic.jpg) no-repeat 50%;
    background-size: 40px;
    overflow: hidden;
}

.user-details {
    flex: 1;
}

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

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

/* Навігаційне меню */
.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-size: 15px;
}

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

.sidebar-nav a.active {
    background: #e0e2e5;
    color: #000;
}

.sidebar-nav .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: 20px;
    background-repeat: no-repeat;
    background-position: 50%;
    opacity: 0.7;
}

.sidebar-nav .icon.i_services{background-image: url(../img/icon/services.svg); }
.sidebar-nav .icon.i_invoices{background-image: url(../img/icon/invoices.svg); }
.sidebar-nav .icon.i_tickets{background-image: url(../img/icon/tickets.svg); }

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Кнопка меню (мобільна версія) */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
}

/* === ОСНОВНИЙ КОНТЕНТ === */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 30px;
    transition: margin-left 0.3s ease;
}

.content-header {
    margin-bottom: 30px;
}

.content-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 400;
}

.content-header a:link, .content-header a:visited{
    color: #627ef5;
    text-decoration: none;
}

.breadcrumb {
    color: var(--text-secondary);
    font-size: 14px;
}

.main-content h1{
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 400;
}
.main-content h2{
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 400;
}
.main-content h3{
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 400;
}

/* === КАРТКИ === */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.stat-card.success {
    border-left-color: var(--secondary-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

/* === ФОРМИ === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    appearance: none;
    padding-right: 40px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* === КНОПКИ === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: var(--secondary-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: #E5E7EB;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* === ТАБЛИЦІ === */
.table-responsive {
    overflow-x: auto;
    margin: 0 -25px;
    padding: 0 25px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: var(--bg-color);
}

.table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

.table tr:hover {
    background: var(--bg-color);
}

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-secondary {
    background: var(--bg-color);
    color: var(--text-secondary);
}

/* === ALERTS === */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: fixed;
    top: 30px;
    right: 30px;
    margin-left: 310px;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 4px solid var(--secondary-color);
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border-left: 4px solid #3B82F6;
}

/* === ЧЕКБОКСИ === */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* === МОДАЛЬНІ ВІКНА === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: var(--bg-color);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* === ПОВІДОМЛЕННЯ ТІКЕТІВ === */
.ticket-messages {
    max-height: 500px;
    overflow-y: auto;
    margin: 20px 0;
}

.ticket-message {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    font-size: 0px;
    background: #CED4D8 url(../img/nopic.jpg) no-repeat 50%;
    background-size: 40px;
    overflow: hidden;
}

.message-avatar.admin {
    background-image: url(../img/admin.webp);
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.message-author {
    font-weight: 600;
    font-size: 14px;
}

.message-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.message-text {
    background: var(--bg-color);
    padding: 12px 15px;
    border-radius: 8px;
    line-height: 1.5;
}

/* === ПУСТА СТОРІНКА === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* === LOADING === */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === РЕСПОНСИВНИЙ ДИЗАЙН === */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .menu-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 80px 15px 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 10px;
    }
    
    .login-box {
        padding: 30px 20px;
    }
    
    .modal-content {
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .content-header h1 {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .card {
        padding: 20px 15px;
    }
}

/* === УТИЛІТИ === */
.text-center {
    text-align: center;
}

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

.text-success {
    color: var(--secondary-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-secondary {
    color: var(--text-secondary);
}
