@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0f4c81; /* Classic Blue */
    --primary-light: #4a90e2;
    --primary-dark: #0a3d6b;
    --secondary-color: #d63031;
    --accent-color: #f8f9fa;
    --text-color: #2d3436;
    --text-muted: #636e72;
    --border-color: #dfe6e9;
    --bg-body: #f4f6f9;
    --sidebar-width: 280px;
    --card-shadow: 0 10px 20px rgba(0,0,0,0.05), 0 6px 6px rgba(0,0,0,0.05);
    --hover-shadow: 0 15px 30px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.05);
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    background-color: var(--bg-body);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    box-shadow: 5px 0 25px rgba(0,0,0,0.03);
    z-index: 100;
}

.logo-container {
    padding: 40px 20px;
    background: transparent;
    color: var(--primary-color);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    padding: 30px 15px;
    margin: 0;
    flex-grow: 1;
}

.nav-links li {
    margin-bottom: 8px;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    border-radius: var(--radius-md);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-links li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: transform var(--transition-speed) ease;
}

.nav-links li a:hover, .nav-links li a.active {
    background-color: rgba(15, 76, 129, 0.05);
    color: var(--primary-color);
    font-weight: 600;
    padding-left: 25px;
}

.nav-links li a.active::before {
    transform: scaleY(1);
}

.nav-links li a svg, .nav-links li a i {
    width: 24px;
    text-align: center;
    font-size: 1.2em;
}

.user-info {
    margin-top: auto;
    padding: 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    background: #fafbfc;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

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

.user-name {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: 2px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 85px 50px 50px 50px; /* Added top padding for disclaimer */
    max-width: 1800px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    padding: 25px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255,255,255,0.5);
}

.page-title {
    font-size: 2rem;
    color: var(--primary-dark);
    margin: 0;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 20px;
    letter-spacing: -1px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,0.03);
    margin-bottom: 35px;
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

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

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


.card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.card-body {
    padding: 25px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.data-table th, .data-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: #f8f9fa;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    border-top: none;
    border-bottom: 2px solid var(--border-color);
}

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

.data-table tr:hover td {
    background-color: rgba(15, 76, 129, 0.02);
    cursor: default;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02) inset;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.1);
}

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

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.1);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    color: var(--text-color);
}

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

.btn-primary { 
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%); 
    color: white; 
    border: 1px solid rgba(255,255,255,0.1);
}

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

.btn-danger { 
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); 
    color: white; 
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-success { 
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); 
    color: white; 
    border: 1px solid rgba(255,255,255,0.1);
}

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

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

/* Badges */
.badge {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
}
.badge-warning { background: #fff8e1; color: #b7791f; border: 1px solid #ffeeba; }
.badge-success { background: #e6fffa; color: #2c7a7b; border: 1px solid #b2f5ea; }
.badge-danger { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.badge-secondary { background: #e2e8f0; color: #4a5568; border: 1px solid #cbd5e0; }
.badge-info { background: #ebf8ff; color: #2b6cb0; border: 1px solid #bee3f8; }

/* Metrics / Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 6px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 100px;
    height: 100px;
    background: var(--primary-color);
    opacity: 0.05;
    border-radius: 50%;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
}

.stat-title {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    font-weight: 600;
}

.stat-value {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.2;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: #fefefe;
    margin: 8% auto;
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 60%;
    max-width: 700px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0,0,0,0.1);
}

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

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

.close-modal {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    background: #f1f3f5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #000;
    background: #e9ecef;
}

/* Alerts */
.alert {
    padding: 20px 25px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    border-left: 6px solid;
    display: flex;
    align-items: center;
    gap: 20px;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.alert-success { background: #f0fff4; border-color: #48bb78; color: #2f855a; }
.alert-error { background: #fff5f5; border-color: #f56565; color: #c53030; }
.alert-info { background: #ebf8ff; border-color: #63b3ed; color: #2b6cb0; }

/* Login Page Styling */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    width: 100%;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 60px;
    border-radius: 20px;
    text-align: center;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 10px 15px -3px rgba(0,0,0,0.1);
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border: 1px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(20px);
}

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

.discord-btn {
    background-color: #5865F2;
    color: white;
    width: 100%;
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(88, 101, 242, 0.4);
}

.discord-btn:hover {
    background-color: #4752c4;
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -5px rgba(88, 101, 242, 0.5);
}

/* Print CSS - Professional PDF Styling */
@media print {
    @page { margin: 0; size: A4; }
    body { 
        background: #fff; 
        margin: 0; 
        padding: 0; 
        color: #000;
        font-family: 'Times New Roman', serif; /* More formal for print */
    }

    .sidebar, 
    .action-buttons-container, 
    .no-print, 
    button, 
    .login-container,
    .stats-grid,
    .user-info,
    .nav-links,
    .logo-container,
    div[style*="SYSTEM ROLEPLAY"], 
    div[style*="z-index:9999"]
    {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }

    .card.invoice-view {
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        padding: 40px !important;
        width: 100% !important;
        min-height: 100vh;
        position: relative;
    }

    .card-header {
        background: none !important;
        border-bottom: 2px solid #000 !important;
        padding-bottom: 20px !important;
        margin-bottom: 30px !important;
    }

    /* Force background colors for badges and accents */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .badge {
        border: 1px solid #000;
        color: #000 !important;
        font-weight: bold;
    }

    .badge-success { background-color: #e6fffa !important; }
    .badge-warning { background-color: #fffaf0 !important; }
    .badge-danger { background-color: #fff5f5 !important; }

    /* Watermark styling for print */
    div[style*="font-size:10rem"] {
        opacity: 0.1 !important;
        color: #000 !important;
        border-color: #000 !important;
    }
    
    /* Official Stamp - make it look like real ink */
    div[style*="border:4px double var(--primary-color)"] {
        border-color: #003366 !important;
        color: #003366 !important;
        opacity: 0.9 !important;
    }

    /* Typography tweaks for print */
    h2, h3 { font-family: 'Arial', sans-serif; color: #000 !important; }
    
    .table thead th {
        background-color: #f0f0f0 !important;
        color: #000 !important;
        border-bottom: 2px solid #000 !important;
        font-weight: bold;
    }

    .table td { border-bottom: 1px solid #ddd !important; }
    
    /* Footer for PDF */
    .invoice-view::after {
        content: "Dokument wygenerowany elektronicznie w systemie KSeF 2.0. Nie wymaga podpisu.";
        position: absolute;
        bottom: 20px;
        left: 0;
        width: 100%;
        text-align: center;
        font-size: 10pt;
        color: #555;
        border-top: 1px solid #ddd;
        padding-top: 10px;
    }
}

