body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    text-align: center;
}

header {
    background-color: #332d93;
    color: white;
    padding: 15px 0;
    font-size: 1.5em;
    font-weight: bold;
}

main {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    margin: 30px auto;
    width: 90%;
    max-width: 1100px;
}

:root{
    --brand: #332d93;
    --brand-2: #2b2580;
    --accent: #337593;
    --muted-red: #c0392b;
    --muted-red-dark: #922b21;
    --bg: #f3f6fb;
    --card: #ffffff;
    --side-width: 320px;
    --muted-text: #5b6270;
    --shadow: 0 8px 24px rgba(51,45,147,0.08);
}

body{ background: var(--bg); font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: #2d3440; }

header{ background: linear-gradient(90deg, rgba(51,45,147,1) 0%, rgba(51,45,147,0.95) 60%); color: #fff; padding: 14px 20px; box-shadow: var(--shadow); display:flex; align-items:center; gap:12px; position:relative; }
header .logo{ display:flex; align-items:center; gap:12px; }
header img{ height:44px; width:auto; object-fit:contain; display:block; }
header .title{ font-weight:600; font-size:1.05rem; letter-spacing:0.2px; }

.container{ max-width:1100px; margin:20px auto; padding:18px; }

.main-grid{ display:grid; grid-template-columns: 1fr 320px; gap:18px; align-items:start; }

.panel{ background: var(--card); border-radius:12px; padding:16px; box-shadow: var(--shadow); }

.calendar-container{ padding:12px; border-radius:10px; }

.day-grid{ display:grid; grid-template-columns: repeat(7, 1fr); gap:10px; }
.day{ min-height:110px; background:linear-gradient(180deg,#ffffff, #fbfdff); border-radius:8px; padding:12px; box-shadow: 0 4px 10px rgba(20,20,50,0.04); display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
.day.empty{ background: transparent; box-shadow:none; border:1px dashed rgba(50,50,50,0.04); }

.day-header{ background:var(--brand); color:#fff; padding:8px 6px; border-radius:6px; font-weight:600; font-size:0.95rem; display:flex; justify-content:center; align-items:center; text-align:center; }
.day .entries{ margin-top:8px; font-size:0.9rem; color:var(--muted-text); flex:1; overflow:auto; }

.legend{ display:flex; flex-direction:column; gap:12px; margin-top:10px; align-items:flex-start; }
.legend h3{ margin:0 0 6px 0; font-size:1.05rem; font-weight:700; }
.legend > div, .legend .legend-item, .legend .item { display:flex; gap:10px; align-items:center; font-size:0.95rem; color:var(--muted-text); }
.legend .legend-color, .legend .dot{ width:18px; height:18px; border-radius:4px; box-shadow:0 1px 3px rgba(0,0,0,0.08); flex-shrink:0; }

.controls{ display:flex; gap:10px; align-items:center; }
select, input[type="number"], input[type="text"]{ 
    padding:8px 10px; 
    border-radius:8px; 
    border:1px solid rgba(30,40,60,0.33); 
    background:#fff; 
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.6);
    transition: all 0.2s ease;
}

select {
    padding: 10px 35px 10px 12px;
    font-size: 1rem;
    font-weight: 500;
    color: #2d3440;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23332d93' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    box-shadow: 0 2px 8px rgba(51,45,147,0.08);
}

select:hover {
    border-color: rgba(51,45,147,0.5);
    box-shadow: 0 4px 12px rgba(51,45,147,0.15);
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15), 0 4px 12px rgba(51,45,147,0.2);
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.btn{ display:inline-block; padding:8px 12px; border-radius:8px; border:none; cursor:pointer; font-weight:600; }
.btn-primary{ background:var(--brand); color:#fff; }
.btn-ghost{ background:transparent; border:1px solid rgba(50,50,50,0.06); color:var(--muted-text); }

.print-btn{ background: var(--accent); color:#fff; padding:8px 12px; border-radius:8px; border:none; box-shadow: 0 6px 18px rgba(51,117,147,0.08); }
.print-btn:hover{ background:#2b6a78; }

a.logout{ background: var(--muted-red); padding:8px 12px; border-radius:8px; box-shadow:none; }
a.logout:hover{ background: var(--muted-red-dark); }

.right-panel{ position:relative; display:flex; flex-direction:column; gap:12px; align-items:stretch; }
.info-box{ padding:12px; border-radius:10px; background:linear-gradient(180deg,#ffffff,#fafbff); border:1px solid rgba(30,40,60,0.03); width:var(--side-width); box-sizing:border-box; }

.modal{ background: rgba(12,14,30,0.55); position:fixed; left:0; top:0; right:0; bottom:0; display:flex; align-items:center; justify-content:center; }
.modal .modal-content{ width:680px; max-width:95%; background:var(--card); padding:18px; border-radius:12px; box-shadow: var(--shadow); }

.small-note{ font-size:0.85rem; color:var(--muted-text); }

/* responsive */
@media (max-width:980px){
  .main-grid{ grid-template-columns: 1fr; }
  .day-grid{ grid-template-columns: repeat(7, minmax(0,1fr)); }
}

/* subtle animations */
.day, .panel{ transition: transform 160ms ease, box-shadow 160ms ease; }
.day:hover{ transform: translateY(-4px); box-shadow: 0 12px 28px rgba(51,45,147,0.06); }

.calendar-container {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

form {
    margin-bottom: 20px;
}

select, input[type="number"], button {
    font-size: 1em;
    padding: 6px 10px;
    margin: 5px;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 20px;
}

.day {
    border: 1px solid #ccc;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 5px;
    transition: 0.2s;
}

.day:hover {
    transform: scale(1.05);
    cursor: pointer;
}

.empty {
    background: #eaeaea;
}

.day-header {
    background: #332d93;
    color: white;
    font-weight: bold;
    padding: 10px 0;
}

.green { background-color: #90ee90; }
.yellow { background-color: #fff176; }
.red { background-color: #ff8a80; }
.gray { background-color: #bdbdbd; }

/* Make day color classes override .day background (use .day.<color> for higher specificity) */
.day.green { background: linear-gradient(180deg,#d4f7d9,#90ee90); color: #08320b; }
.day.yellow { background: linear-gradient(180deg,#fff9c8,#fff176); color: #5a4b00; }
.day.red { background: linear-gradient(180deg,#ffd6d6,#ff8a80); color: #4a1a17; }
.day.gray { background: linear-gradient(180deg,#f0f0f0,#bdbdbd); color: #222; }
.day.black { background: linear-gradient(180deg,#4a4a4a,#222); color: #fff; }

.legend { background: var(--card); border-radius:12px; padding:18px; box-shadow:var(--shadow); width:var(--side-width); box-sizing:border-box; }
.legend h3 { margin:0 0 12px 0; font-size:1.1rem; font-weight:700; color:#2f3740; }
.legend > div, .legend .legend-item, .legend .item { display:flex; gap:12px; align-items:flex-start; font-size:0.98rem; color:#3b3f45; line-height:1.4; }
.legend .legend-color, .legend .dot { width:16px; height:16px; border-radius:6px; flex-shrink:0; box-shadow: 0 3px 8px rgba(20,24,40,0.06); margin-top:4px; }
.green-box { background-color: #90ee90; }
.yellow-box { background-color: #fff176; }
.red-box { background-color: #ff8a80; }
.gray-box { background-color: #bdbdbd; }

a.logout {
    display: inline-block;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 16px;
    background: #c0392b;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

a.logout:hover {
    background: #922b21;
}

.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    text-align: center;
}

.modal-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
}

.modal-content button {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.modal-content button[type="submit"] {
    background-color: #007bff;
    color: white;
}

#closeModal {
    background-color: #dc3545;
    color: white;
}

.employee-select {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    text-align: left;
    width: var(--side-width);
    margin-top: 20px;
}

.employee-select h3 {
    text-align: center;
    margin-bottom: 15px;
}

.right-panel {
    display: flex;
    flex-direction: column;
        align-items: center;
    gap: 20px;
}

/* Ensure all right-panel cards match legend width in admin pages */
.right-panel > .legend,
.right-panel > .employee-select,
.right-panel > .add-user-box,
.right-panel > .info-box {
    width: var(--side-width);
    box-sizing: border-box;
}

/* responsive: on narrow screens, side cards should be full width */
@media (max-width: 980px) {
    .legend, .employee-select, .add-user-box, .info-box { width: 100%; }
}

.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
    text-align: left;
}

.modal-content h3 {
    margin-top: 0;
    text-align: center;
}

.modal .close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
}

.modal .close:hover {
    color: red;
}

.add-user-box {
    margin-top: 12px;
    width: var(--side-width);
    box-sizing: border-box;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.06);
    text-align: left;
}

.add-user-box form { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.add-user-box h3 { text-align: center; margin: 6px 0 8px 0; }
.add-user-box label { display:block; width:100%; text-align:center; margin:0 0 6px 0; padding:0; color: #2f3740; }
.add-user-box input, .add-user-box select { width: 92%; padding: 8px 10px; margin: 0 auto; font-size: 0.98rem; border-radius:6px; box-sizing: border-box; }
.add-user-box form br { display: none; }
.add-user-box button, .employee-select button, .panel-btn { background-color: #007bff; color:#fff; border:none; padding:8px 14px; border-radius:6px; cursor:pointer; display:block; margin:6px auto 0; }
.add-user-box button:hover, .employee-select button:hover, .panel-btn:hover { background-color:#0056b3; }
.add-user-box > *,
.add-user-box form > * {
    margin: 6px auto 0;
}

/* Keep the calendar "Pokaż" button inline with year/month inputs */
#calendarForm .panel-btn {
    display: inline-block;
    margin: 0 6px;
    vertical-align: middle;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 90vh;
    background-color: #f5f5f5;
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 30px 40px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    text-align: center;
    width: 350px;
}

.login-box h2 {
    margin-bottom: 20px;
    color: #007bff;
}

.login-form input {
    width: 90%;
    padding: 8px;
    margin: 8px 0;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1em;
}

.login-form button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.2s;
}

.login-form button:hover {
    background-color: #0056b3;
}

.error-msg {
    color: #dc3545;
    margin-top: 15px;
    font-weight: bold;
}

.black {
    background-color: #222;
    color: white;
}

.black-box {
    width: 20px;
    height: 20px;
    background-color: #222;
    display: inline-block;
    margin-right: 5px;
}

.print-btn {
    background-color: #337593;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 10px;
}/* Modern Login Page Styles */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 50px 45px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.login-header {
    margin-bottom: 35px;
}

.login-logo {
    width: 180px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
}

.login-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: 2px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    color: #4a5568;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #f7fafc;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.login-submit-btn:active {
    transform: translateY(0);
}

.forgot-password {
    display: block;
    text-align: center;
    color: #667eea;
    font-size: 0.95rem;
    text-decoration: none;
    margin-top: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #764ba2;
    text-decoration: underline;
}

.login-page .error-msg {
    color: #e53e3e;
    margin-top: 20px;
    font-weight: 600;
    padding: 12px;
    background: #fff5f5;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
}
/* ---- Login page full-bleed gradient and card ---- */
body.login-page {
    /* Full-page gradient background */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Override generic main layout on the login page */
body.login-page main.login-container {
    width: 100%;
    max-width: none;
    margin: 0;            /* remove outer white/grey area */
    gap: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent; /* no background panel */
}

/* Neutralize old login styles that added a grey panel */
body.login-page .login-container {
    height: auto;
    background: transparent !important;
}

/* Modern login card visuals */
.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 50px 45px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.login-header { margin-bottom: 28px; }
.login-logo { width: 260px; height: auto; margin: 0 auto 18px; display: block; }
.login-title { font-size: 2.4rem; font-weight: 800; color: #1a1a1a; letter-spacing: 2px; margin: 0; }

.login-form { display: flex; flex-direction: column; gap: 18px; }
.form-group { text-align: left; }
.form-group label { display:block; font-size:0.95rem; color:#4a5568; margin-bottom:8px; font-weight:500; }
.form-group input { width:100%; padding:14px 16px; border:2px solid #e2e8f0; border-radius:10px; font-size:1rem; background:#f7fafc; transition: all .2s ease; box-sizing:border-box; }
.form-group input:focus { outline:none; border-color:#667eea; background:#fff; box-shadow:0 0 0 3px rgba(102,126,234,.12); }

.login-submit-btn { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color:#fff; border:none; padding:14px 18px; border-radius:10px; font-size:1.05rem; font-weight:700; cursor:pointer; box-shadow:0 4px 14px rgba(102,126,234,.35); transition:transform .15s ease, box-shadow .15s ease; }
.login-submit-btn:hover { transform: translateY(-2px); box-shadow:0 8px 22px rgba(102,126,234,.45); }
.login-submit-btn:active { transform: translateY(0); }

.forgot-password { display:block; text-align:center; color:#667eea; text-decoration:none; font-size:0.95rem; margin-top:14px; }
.forgot-password:hover { color:#764ba2; text-decoration:underline; }

/* Error message styling within login page */
body.login-page .error-msg { color:#e53e3e; margin-top:18px; font-weight:600; padding:12px; background:#fff5f5; border-radius:8px; border-left:4px solid #e53e3e; }

/* Calendar pages gradient background */
body.calendar-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Calendar pages header styling */
body.calendar-page header {
    max-width: 1200px;
    margin: 20px auto;
    border-radius: 16px;
    padding: 10px 20px;
}
/* Updated button styles with animations and gradients */

/* Print button with gradient and animation */
.print-btn{ 
    background: linear-gradient(135deg, #337593 0%, #2b6a78 100%);
    color:#fff; 
    padding:8px 12px; 
    border-radius:8px; 
    border:none; 
    box-shadow: 0 4px 14px rgba(51,117,147,0.3);
    transition: transform .15s ease, box-shadow .15s ease;
    cursor: pointer;
}
.print-btn:hover{ 
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51,117,147,0.4);
}
.print-btn:active {
    transform: translateY(0);
}

/* Logout button with gradient and animation */
a.logout{ 
    background: linear-gradient(135deg, #c0392b 0%, #922b21 100%);
    padding:8px 16px; 
    border-radius:8px; 
    box-shadow: 0 4px 14px rgba(192,57,43,0.3);
    transition: transform .15s ease, box-shadow .15s ease;
    display: inline-block;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
}
a.logout:hover{ 
    transform: translateY(calc(-50% - 2px));
    box-shadow: 0 6px 20px rgba(192,57,43,0.4);
}
a.logout:active {
    transform: translateY(-50%);
}

/* Panel buttons (Pokaż, Zatwierdź, etc.) with gradient and animation */
.add-user-box button, .employee-select button, .panel-btn { 
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color:#fff; 
    border:none; 
    padding:8px 14px; 
    border-radius:6px; 
    cursor:pointer; 
    display:block; 
    margin:6px auto 0;
    box-shadow: 0 4px 14px rgba(0,123,255,0.3);
    transition: transform .15s ease, box-shadow .15s ease;
}
.add-user-box button:hover, .employee-select button:hover, .panel-btn:hover { 
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.4);
}
.add-user-box button:active, .employee-select button:active, .panel-btn:active {
    transform: translateY(0);
}

/* Modal buttons animations and gradients */
.modal-content button[type="submit"] {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,123,255,0.3);
    transition: transform .15s ease, box-shadow .15s ease;
}
.modal-content button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.4);
}
.modal-content button[type="submit"]:active {
    transform: translateY(0);
}

#closeModal {
    background: linear-gradient(135deg, #dc3545 0%, #a71d2a 100%);
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(220,53,69,0.3);
    transition: transform .15s ease, box-shadow .15s ease;
}
#closeModal:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220,53,69,0.4);
}
#closeModal:active {
    transform: translateY(0);
}

/* Success message style */
.success-msg {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.95rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(21, 87, 36, 0.1);
}
