body {
    font-family: sans-serif;
    padding: 1rem;
    margin: 0;
    background: #fff;
}
		h1 {
            text-align: center;
            margin-bottom: 1.5rem;
        }
        .intro {
            text-align: center;
            margin-bottom: 1.5rem;
            color: #444;
            font-size: 0.95rem;
        }
        .grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 1rem;
        }
/* Global link style for page content only (not header/nav pills) */
/* Global link style for content areas (not header/nav pills) */
.page-inner a,
.page-narrow a,
.footer a,
.msg a,
.intro a,
.danger a, 
.top-link a{
    color: #c8102e;
    text-decoration: none;
	font-weight: bold;
}

.page-inner a:hover,
.page-narrow a:hover,
.footer a:hover,
.msg a:hover,
.intro a:hover,
.danger a:hover,
.page-inner a:focus-visible,
.page-narrow a:focus-visible,
.footer a:focus-visible,
.msg a:focus-visible,
.intro a:focus-visible,
.danger a:focus-visible,
.top-link a:focus-visible
{
    text-decoration: underline;
}

.page-inner a:visited,
.page-narrow a:visited,
.footer a:visited,
.msg a:visited,
.intro a:visited,
.danger a:visited, 
.top-link a:visited
{
    color: #c8102e;
}

/* Base form controls – shared everywhere */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
select {
    font-size: 0.9rem;
    padding: 0.25rem 0.35rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
}


.card {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0.9rem 1rem;
    background: #fafafa;

    /* new bits for equal-height + bottom link */
    display: flex;
    flex-direction: column;
}        .card h2 {
            margin: 0 0 0.4rem 0;
            font-size: 1.05rem;
        }
        .card p {
            margin: 0.2rem 0 0.6rem 0;
            font-size: 0.9rem;
            color: #555;
        }
.card a {
    display: inline-block;
    color: #c8102e;
    text-decoration: none;
    font-weight: bold;

    margin-top: auto;
    padding-top: 0.4rem; /* optional visual gap from text */
}        .card a:hover {
            text-decoration: underline;
        }

        .top-link {
            text-align: center;
            margin-bottom: 1rem;
			margin-top: 0.5em;
        }

        .nav { text-align: center; margin-bottom: 1rem; }
        .nav a { margin: 0 0.5rem; }
        .date-picker { text-align: center; margin-bottom: 1rem;}
        .date-picker input[type="date"] { padding: 0.2rem;}
		.date-picker button, .add-shift-box button, .shift-list button, .add-box button, .actions button{display: inline-block;
    padding: 0.3rem 0.8rem;
    font-size: 0.95rem;
    border-radius: 6px;
    border: 1px solid #c8102e;
    background: #ffffff;
    color: #c8102e;
    cursor: pointer;
	}
		.date-picker button:hover, .add-shift-box button:hover, .shift-list button:hover, .add-box button:hover, .actions button:hover{background: #c8102e; color: #ffffff;}

table {
    border-collapse: collapse;
    margin: 0 auto;
    width: auto;
    table-layout: fixed;
    font-size: 0.8rem;
}
        th.time-col, td.time-col {
            width: 4rem;
            white-space: nowrap;
            background: #fafafa;
        }
        th.dept-header {
            background: #f0f0f0;
        }
        th.vol-header {
            background: #fafafa;
        }
        .slot-label {
            font-size: 0.7rem;
        }
        .total-row {
            font-weight: bold;
            background: #f9f9f9;
        }
        .dept-separator {
            border-right: 3px solid #999 !important;
        }
        .add-shift-box {
            margin: 0 auto 1rem auto;
            max-width: 900px;
            border: 1px solid #ccc;
            padding: 0.5rem 0.75rem;
            border-radius: 4px;
            background: #f9f9f9;
            font-size: 0.9rem;
        }
        .add-shift-box form {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            align-items: center;
            justify-content: center;
        }
        .add-shift-box label {
            font-weight: bold;
        }
        .add-shift-box input[type="date"],
        .add-shift-box input[type="time"],
        .add-shift-box select,
        .add-shift-box input[type="text"] {
            padding: 0.2rem;
            font-size: 0.9rem;
        }
        .weekday-group {
            display: flex;
            flex-wrap: wrap;
            gap: 0.25rem;
            align-items: center;
        }
        .weekday-group label {
            font-weight: normal;
        }
        .error {
            color: #b00020;
            margin-bottom: 0.5rem;
            text-align: center;
            font-weight: bold;
        }
        .shift-list {
            margin-top: 1.5rem;
            font-size: 0.8rem;
        }
        .shift-list td form {
            margin: 0;
		}

        h2.day-title {
            margin-top: 1.0rem;
            margin-bottom: 0.3rem;
			text-align: Center;
        }

		.day-title a {
			color: #c8102e;
			text-decoration: none;
			font-weight: 600;
			margin: 0 0.5rem;
		}
		.day-title a:hover {
			text-decoration: underline;
		}
th, td {
    border: 1px solid #ccc;
    padding: 0.4rem 0.8rem;   /* from the later block */
    text-align: center;
    vertical-align: top;      /* from the earlier block */
}
        th { background: #eee; }
        .pos { color: #006400; }
        .neg { color: #a00; }

        .small { font-size: 0.7rem; color: #555; }

        .empty {
            text-align: center;
            margin-top: 1rem;
            font-style: italic;
        }

        input[type="date"],
        input[type="time"],
        select {
            font-size: 0.8rem;
        }
        .actions button {
            margin: 0 0.1rem;
        }
		a.actions:hover,
a.actions:focus-visible {
    text-decoration: none; /* explicitly override global underline */
}


        .year-input {
            width: 5em;
            text-align: center;
        }
        .inactive {
            color: #777;
        }


        .msg {
            text-align: center;
            margin-bottom: 0.5rem;
            font-weight: bold;
        }
        .msg.error { color: #b00020; }
        .msg.success { color: #006400; }

        .add-box {
            margin: 0 auto 1rem auto;
            border: 1px solid #ccc;
            padding: 0.5rem 0.75rem;
            border-radius: 4px;
            background: #f9f9f9;
            font-size: 0.9rem;
        }
        .add-box form {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            align-items: center;
            justify-content: center;
        }
        .add-box label { font-weight: bold; }

        td form { margin: 0; display: inline; }
        .actions { white-space: nowrap; }

        h2 {
            margin-top: 1.5rem;
            margin-bottom: 0.5rem;
        }
        .danger {
            background: #fee;
            border: 1px solid #f99;
            padding: 0.5rem;
            margin: 1rem 0;
            font-size: 0.9rem;
        }

.login form {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 1rem;
    background: #fafafa;
}

.login form button {
    margin-top: 0.8rem;
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
}
        label {
            display: block;
            margin-bottom: 0.6rem;
        }
        label span {
            display: inline-block;
            min-width: 110px;
        }
		input[type="text"],
		input[type="password"],
		input[type="email"],
		input[type="number"] {
            width: 100%;
            box-sizing: border-box;
            padding: 0.4rem;
            font-size: 1rem;
        }
        .back-link {
            text-align: center;
            margin-top: 0.8rem;
            font-size: 0.9rem;
        }
        .back-link a {
			color: #c8102e;
            text-decoration: none;
        }

        .btn {
            display: inline-block;
            padding: 0.8rem 1.5rem;
            margin: 0.5rem;
            font-size: 1rem;
            cursor: pointer;
        }
        .btn-primary {
            background: #007bff;
            color: #fff;
            border: none;
        }
        .btn-secondary {
            background: #e0e0e0;
            border: none;
        }
		.btn-green {
            background: green;
            color: #fff;
            border: none;
        }
        .btn-red {
            background: red;
            color: #fff;
            border: none;
        }
		.btn-yellow {
			background: #ffc107;
			border: none;
			color: #000;
		}

        .pin-input {
            font-size: 1.5rem;
            padding: 0.5rem;
            text-align: center;
            width: 8rem;
        }

.pa-header {
    background: #ffffff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pa-header-inner {
    max-width: 900px;   /* menu+logo locked to 900px */
    margin: 0 auto;
    padding: 0.25rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
	border-bottom: 4px solid #c8102e;   /* punainen korostus */

}
.pa-logo {
    height: 58px;
    width: auto;
    display: block;
}

.pa-logo-link {
    display: inline-flex;
    align-items: center;
}

.pa-main-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.pa-nav-link,
.pa-dropbtn {
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    color: #333333;
    transition: background-color 0.15s ease, color 0.15s ease;

    /* force identical text appearance */
    font-family: inherit;
    font-weight: 500;          /* pick any weight you like, but same for both */
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
}

/* buttonille tarvitaan nämä, ettei tule selaimen oletustyyliä */
.pa-dropbtn {
    background: none;
    border: none;
    cursor: pointer;
}

/* Hover-tyyli molemmille */
.pa-nav-link:hover,
.pa-nav-link:focus-visible,
.pa-dropbtn:hover,
.pa-dropbtn:focus-visible {
    background: #c8102e;
    color: #ffffff;
}

/* DROPDOWN-RUNKO */
.pa-dropdown {
    position: relative;
    display: inline-block;
}

/* Pudotusvalikon sisältö (oletuksena piilossa) */
.pa-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 200px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 0.25rem 0;
    z-index: 1000;
}

/* Linkit pudotusvalikossa */
.pa-dropdown-content a {
    display: block;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.35rem 0.9rem;
    color: #333333;
    text-transform: none;
    letter-spacing: 0;
    border-radius: 0;
}

.pa-dropdown-content a:hover {
    background: #f5f5f5;
    color: #c8102e;
}

/* Näytä dropdown hoverilla (desktop) */
.pa-dropdown:hover .pa-dropdown-content {
    display: block;
}

.pa-dropdown:hover > .pa-dropbtn,
.pa-dropdown:focus-within > .pa-dropbtn {
    background: #c8102e;
    color: #f5f5f5;
}



/* Mobiili: pinotaan linkit tarvittaessa */
@media (max-width: 600px) {
    .pa-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .pa-main-nav {
        width: 100%;
        flex-wrap: wrap;
        row-gap: 0.25rem;
    }

    /* Mobiilissa pudotusvalikko täysleveäksi ja ilman absolute-positionia */
    .pa-dropdown {
        width: 100%;
    }

    .pa-dropdown-content {
        position: static;
        box-shadow: none;
        background: transparent;
        min-width: 0;
        padding: 0;
    }

    .pa-dropdown-content a {
        padding-left: 1.5rem; /* pieni sisennys alalinkkeihin */
    }
}
.page-inner {
    max-width: 900px;
    margin: 1.5rem auto;
    padding: 0 1.5rem 1.5rem;
}

.page-narrow {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

/* Center form fields only on index.php */

.page-narrow label {
    display: block;
    text-align: left;
    margin: 0.5rem 0;
}

.page-narrow input[type="text"],
.page-narrow input[type="password"],
.page-narrow input[type="number"] {
    width: 100%;
    padding: 0.4rem;
    font-size: 1rem;
    box-sizing: border-box;
}

.page-narrow button {
    display: inline-block;
    width: auto;         /* don't stretch */
    padding: 0.5rem 1rem;
    font-size: 1rem;
    margin-top: 1rem;
}


.daynav a {
    color: #c8102e;
    text-decoration: none;
    font-weight: 600;
    margin: 0 0.5rem;
}
.daynav a:hover {
    text-decoration: underline;
}

tr.shift-highlight td,
tr.timelog-highlight td  {
    background-color: #fff3cd;   /* or whatever you use */
    transition: background-color 0.2s ease;
}

/* Links used as shift time labels in the grid */
a.slot-label {
    color: #c8102e;
    text-decoration: none;
    font-weight: 600;

    background: #fff;          /* always readable */
    padding: 1px 4px;          /* subtle */
    border-radius: 3px;        /* soft corners */
    display: inline-block;     /* ensures padding works correctly */
}

a.slot-label:hover,
a.slot-label:focus {
    text-decoration: underline;
}

a.slot-label:visited {
    color: #c8102e;
}

th.vol-header a {
    color: #c8102e;
    text-decoration: none;
    font-weight: 600;
}
th.vol-header a:hover {
    text-decoration: underline;
}
/* Base style for all checkboxes */
input[type="checkbox"] {
    accent-color: #c8102e;   /* brand red */
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    margin: 0 0.2rem 0 0;
    vertical-align: middle;
}

        /* Korosta tarkistettavat rivit */
        .sus-row {
            background: #fff3cd;
        }
.footer {
 max-width: 900px;
    margin: 0 auto;
    padding: 0.6rem;
    border-top: 2px solid #c8102e;
	text-align: center;
}

/* Make <a class="actions"> look like your red-outline buttons */
a.actions {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    font-size: 0.95rem;
    border-radius: 6px;
    border: 1px solid #c8102e;
    background: #ffffff;
    color: #c8102e;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2; /* helps vertical alignment with buttons */
    font-weight: normal;
}

a.actions:hover,
a.actions:focus-visible {
    background: #c8102e;
    color: #ffffff;
    text-decoration: none;
}


/* Submenu container acts like a row inside the dropdown */
.pa-submenu {
  position: relative;
}

/* Make submenu trigger look like your normal dropdown links */
.pa-submenu-btn {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

/* The flyout panel */
.pa-submenu-content {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 6px;

  min-width: 220px;
  z-index: 9999;

  background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
}

/* Show flyout on hover */
.pa-submenu:hover > .pa-submenu-content {
  display: block;
}

/* Optional: keep flyout open if hovering the trigger */
.pa-submenu:hover > .pa-submenu-btn {
  background: rgba(0,0,0,.05);
  border-radius: 8px;
}

.details-row { display:none; }
.details-box {
  background: rgba(0,0,0,.03);
  border: 1px solid rgba(0,0,0,.10);
  border-radius: .5rem;
  padding: .75rem;
  margin: .25rem 0;
}
.btn-link {
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.subtable { width:100%; border-collapse:collapse; table-layout: fixed; margin-top:.5rem; }
.subtable th, .subtable td { padding:.25rem .35rem; border-top:1px solid rgba(0,0,0,.08); vertical-align:top; white-space: normal; word-break: break-word; }
