/* DigiDay Majetek - Main Stylesheet */
/* Firemní barva: #c5267c */

:root {
    --primary: #c5267c;
    --primary-hover: #a31f66;
    --primary-light: #f8e8f1;
    --primary-dark: #8a1b57;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Layout ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--gray-200);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-logo svg {
    width: 36px;
    height: 36px;
    color: var(--primary);
}

.sidebar-logo-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.sidebar-logo-text span {
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-200);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--gray-50);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 500;
    color: var(--gray-900);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.page-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 24px 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-body {
    padding: 32px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.5;
}

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

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

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
}

.btn-icon {
    padding: 8px;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ===== Cards ===== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

.stat-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-icon.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
}

.table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.table th a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.table th a:hover {
    color: var(--primary);
}

.table td {
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    color: var(--gray-800);
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px var(--danger-light);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

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

.form-text {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.form-error {
    font-size: 13px;
    color: var(--danger);
    margin-top: 4px;
}

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

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 100px;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

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

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ===== Alerts ===== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 1.5;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.alert-info {
    background: var(--info-light);
    color: #1e40af;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.15s ease;
}

.pagination-item:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.pagination-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Filters ===== */
.filters {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filters-row .form-group {
    margin-bottom: 0;
    min-width: 180px;
}

.filters-row .form-group.search {
    flex: 1;
    min-width: 250px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
    stroke-width: 1;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 15px;
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== Detail Page ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.detail-section {
    margin-bottom: 32px;
}

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

.detail-section-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.detail-label {
    width: 160px;
    flex-shrink: 0;
    font-size: 14px;
    color: var(--gray-500);
}

.detail-value {
    flex: 1;
    font-size: 15px;
    color: var(--gray-800);
}

/* ===== QR Code ===== */
.qr-card {
    text-align: center;
}

.qr-code {
    display: inline-block;
    padding: 16px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.qr-code img {
    display: block;
    width: 200px;
    height: 200px;
}

/* ===== Attachments ===== */
.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.attachment-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: white;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.attachment-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-meta {
    font-size: 12px;
    color: var(--gray-500);
}

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

/* ===== Print Label ===== */
@media print {
    .print-label {
        width: 210mm;
        padding: 20mm;
        background: white;
    }
    
    .print-label-header {
        text-align: center;
        margin-bottom: 20mm;
    }
    
    .print-label-qr {
        text-align: center;
        margin-bottom: 10mm;
    }
    
    .print-label-qr img {
        width: 50mm;
        height: 50mm;
    }
    
    .print-label-info {
        font-size: 12pt;
    }
    
    .print-label-info dt {
        font-weight: 600;
        color: #666;
    }
    
    .print-label-info dd {
        margin-bottom: 5mm;
        font-size: 14pt;
    }
}

/* ===== Login Page ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
    padding: 24px;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo svg {
    width: 56px;
    height: 56px;
    color: var(--primary);
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
    text-align: center;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 15px;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 32px;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form .btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 16px 20px;
    }
    
    .page-body {
        padding: 20px;
    }
    
    .page-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .filters-row .form-group {
        width: 100%;
    }
}

/* ===== Utilities ===== */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--gray-500) !important; }

.bg-primary { background: var(--primary) !important; }
.bg-primary-light { background: var(--primary-light) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mt-4 { margin-top: 32px !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-4 { margin-bottom: 32px !important; }

.d-flex { display: flex !important; }
.align-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.gap-1 { gap: 8px !important; }
.gap-2 { gap: 16px !important; }

.w-100 { width: 100% !important; }
