@import url('https://rsms.me/inter/inter.css');

:root {
    --emerald: #10b981;
    --emerald-dark: #059669;
    --charcoal: #2d3748;
    --charcoal-light: #4a5568;
    --cream: #f5f1eb;
    --beige: #ede8e0;
}

html,
body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    background-color: var(--cream);
    color: var(--charcoal);
    letter-spacing: 0.3px;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--charcoal);
    font-weight: 600;
    letter-spacing: 0.2px;
}

.wrap {
    min-height: 100%;
    height: auto;
    margin: 0 auto -60px;
    padding: 0 0 60px;
    background-color: var(--cream);
}

.wrap > .container {
    padding: 70px 15px 20px;
}

.site-index {
    max-width: 1200px;
    margin: 0 auto;
}

.footer {
    height: 60px;
    background-color: var(--charcoal);
    color: var(--cream);
    border-top: 3px solid var(--emerald);
    padding-top: 20px;
    color: var(--cream);
}

/* Select/dropdown styling */
select.form-control {
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%232d3748" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.jumbotron {
    text-align: center;
    background-color: transparent;
}

.jumbotron .btn {
    font-size: 21px;
    padding: 14px 24px;
}

.not-set {
    color: #c55;
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    position: relative;
    top: 1px;
    display: inline-block;
    font-family: 'Glyphicons Halflings';
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    padding-left: 5px;
}

a.asc:after {
    content: /*"\e113"*/ "\e151";
}

a.desc:after {
    content: /*"\e114"*/ "\e152";
}

.sort-numerical a.asc:after {
    content: "\e153";
}

.sort-numerical a.desc:after {
    content: "\e154";
}

.sort-ordinal a.asc:after {
    content: "\e155";
}

.sort-ordinal a.desc:after {
    content: "\e156";
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
    padding: 8px 16px;
    border: 2px solid var(--emerald);
    background-color: transparent;
    color: var(--emerald);
    font-weight: 600;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    margin-bottom: 10px;
}

@media(max-width:767px) {
    .nav li > form > button.logout {
        display: block;
        text-align: left;
        width: 100%;
        padding: 12px 15px;
        margin: 5px 0;
    }
}

.nav > li > form > button.logout:focus,
.nav > li > form > button.logout:hover {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--emerald-dark);
    color: var(--emerald-dark);
    text-decoration: none;
}

.nav > li > form > button.logout:focus {
    outline: none;
}

/* ===== MODERN CARD-BASED DESIGN ===== */

/* Cards */
.card, .modern-card {
    background-color: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(45, 55, 72, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 24px;
    overflow: hidden;
}

.card:hover, .modern-card:hover {
    box-shadow: 0 8px 16px rgba(45, 55, 72, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-dark) 100%);
    color: white;
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    border: none;
}

.card-body {
    padding: 24px;
}

.card-footer {
    background-color: var(--beige);
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
}

/* Buttons */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border-radius: 8px;
    padding: 10px 20px;
    border: none;
    transition: all 0.3s ease;
    text-transform: none;
}

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

.btn-primary:hover, .btn-primary:active {
    background-color: var(--emerald-dark);
    color: white;
}

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

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

.btn-accent {
    background-color: var(--charcoal);
    color: white;
    font-weight: 600;
}

.btn-accent:hover {
    background-color: var(--charcoal-light);
    color: white;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent;
    padding: 12px 0;
    margin-bottom: 24px;
    border-radius: 8px;
}

.breadcrumb > li + li:before {
    content: "›";
    color: var(--charcoal-light);
    padding: 0 10px;
    font-weight: bold;
}

.breadcrumb > li {
    color: var(--charcoal-light);
}

.breadcrumb > li > a {
    color: var(--emerald);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb > li > a:hover {
    color: var(--emerald-dark);
    text-decoration: underline;
}

.breadcrumb > .active {
    color: var(--charcoal);
    font-weight: 500;
}

/* Forms */
.form-control {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    min-height: 48px;
    transition: all 0.3s ease;
    background-color: white;
}

.form-control:focus {
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.control-label {
    font-weight: 500;
    color: var(--charcoal);
    margin-bottom: 8px;
}

.help-block {
    color: #6b7280;
    font-size: 14px;
    margin-top: 4px;
}

/* Login Page */
.site-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.site-login .modern-card {
    width: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(45, 55, 72, 0.12);
    padding: 40px;
}

.login-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--cream);
}

.login-icon {
    width: 48px;
    height: 48px;
    color: var(--emerald);
    flex-shrink: 0;
}

.login-app-name {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--charcoal);
}

.login-subtitle {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: var(--charcoal-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.site-login h1 {
    text-align: center;
    margin: 0 0 8px 0;
    font-size: 24px;
    color: var(--charcoal);
}

.site-login > .login-container > p {
    text-align: center;
    color: var(--charcoal-light);
    margin-bottom: 30px;
    font-size: 14px;
}

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

.site-login .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.site-login .form-group input[type="text"],
.site-login .form-group input[type="password"] {
    width: 100%;
    box-sizing: border-box;
}

.site-login .btn-primary {
    width: 100%;
    font-size: 16px;
    padding: 14px 20px;
    font-weight: 600;
    min-height: 48px;
}

/* Sticky Footer Bar */
.sticky-footer-bar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: 50px;
    padding: 12px 18px;
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.2);
    z-index: 999;
    animation: slideInRight 0.4s ease-out;
    transition: all 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sticky-footer-bar:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
}

.sticky-footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--charcoal);
    letter-spacing: 0.3px;
}

.sticky-footer-text {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .sticky-footer-bar {
        bottom: 10px;
        right: 10px;
        padding: 10px 14px;
        font-size: 11px;
    }
}

/* Index Page */
.site-index {
    padding: 20px 0;
}

.site-index .topBar {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 40px;
}

.site-index .topBar img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(45, 55, 72, 0.12);
}

.pContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 24px;
    margin-bottom: 40px;
}

.pBox {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(45, 55, 72, 0.1);
    border-left: 4px solid var(--emerald);
    transition: all 0.3s ease;
    line-height: 1.6;
}

.pBox:hover {
    box-shadow: 0 8px 16px rgba(45, 55, 72, 0.15);
    transform: translateY(-4px);
}

/* Statistics Cards */
.stats-top-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 18px;
    margin-bottom: 32px;
}

.stat-card-horizontal {
    background: white;
    border-radius: 12px;
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 6px rgba(45, 55, 72, 0.08);
    transition: all 0.3s ease;
}

.stat-card-horizontal:hover {
    box-shadow: 0 6px 12px rgba(45, 55, 72, 0.12);
    transform: translateY(-2px);
}

.stat-icon-circle {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-circle svg {
    width: 32px;
    height: 32px;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: inherit;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--charcoal);
    line-height: 1.1;
}

.stat-title {
    font-size: 13px;
    color: var(--charcoal-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
}

/* Quick Actions */
.quick-actions-full-width {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    grid-gap: 12px;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-radius: 10px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    gap: 12px;
}

.action-button:visited,
.action-button:active,
.action-button:focus {
    text-decoration: none !important;
    outline: none;
}

.action-emerald {
    background-color: var(--emerald);
    color: white !important;
}

.action-emerald:hover,
.action-emerald:visited,
.action-emerald:active {
    background-color: var(--emerald-dark);
    color: white !important;
    text-decoration: none !important;
}

.action-emerald:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.25);
}

.action-charcoal {
    background-color: var(--charcoal);
    color: white !important;
}

.action-charcoal:hover,
.action-charcoal:visited,
.action-charcoal:active {
    background-color: var(--charcoal-light);
    color: white !important;
    text-decoration: none !important;
}

.action-charcoal:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 12px rgba(45, 55, 72, 0.25);
}

.action-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon svg {
    width: 18px;
    height: 18px;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: inherit;
}

.action-text {
    flex: 1;
    text-align: left;
}

.action-arrow {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-arrow svg {
    width: 16px;
    height: 16px;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: inherit;
}

.action-button:hover .action-arrow {
    opacity: 1;
}

/* Navbar styling */
.navbar-inverse {
    background-color: var(--charcoal);
    border-bottom: 3px solid var(--emerald);
}

.navbar-inverse .navbar-brand {
    color: var(--emerald) !important;
    font-weight: 700;
    font-size: 18px;
    padding: 0 !important;
    margin-right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
    background: none !important;
    border-radius: 0 !important;
}

.navbar-inverse .navbar-brand:hover {
    color: var(--emerald-dark) !important;
    background: none !important;
}

.navbar-brand-icon {
    width: 20px;
    height: 20px;
    color: var(--emerald);
    flex-shrink: 0;
    margin-right: 6px !important;
}

.navbar-inverse .nav > li > a {
    color: var(--cream) !important;
    transition: color 0.2s;
}

.navbar-inverse .nav > li > a:hover {
    color: var(--emerald) !important;
    background-color: rgba(16, 185, 129, 0.1);
}

/* Dropdown menu fixes */
.navbar-inverse .dropdown-menu {
    background-color: var(--charcoal);
    border: 1px solid var(--emerald);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.navbar-inverse .dropdown-menu > li > a {
    color: #e0e0e0 !important;
    transition: all 0.2s;
}

.navbar-inverse .dropdown-menu > li > a:hover {
    background-color: var(--emerald);
    color: white !important;
    font-weight: 500;
}

.navbar-inverse .dropdown-menu > .active > a,
.navbar-inverse .dropdown-menu > .active > a:hover,
.navbar-inverse .dropdown-menu > .active > a:focus {
    background-color: var(--emerald);
    color: white;
}

.navbar-inverse .dropdown-menu > li.dropdown-header {
    color: var(--emerald);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    padding: 10px 15px;
    background-color: rgba(16, 185, 129, 0.05);
}

.navbar-inverse .dropdown-menu > li > a:focus {
    background-color: rgba(16, 185, 129, 0.2);
    color: #e0e0e0;
}

/* Nested dropdown and submenu links */
.navbar-inverse .dropdown-menu a {
    color: #e0e0e0 !important;
    text-decoration: none !important;
}

.navbar-inverse .dropdown-menu a:hover,
.navbar-inverse .dropdown-menu a:focus {
    color: white !important;
    background-color: var(--emerald) !important;
    text-decoration: none !important;
}

/* Remove default link styling from submenu items */
.navbar-inverse .dropdown-menu li a {
    background-color: transparent;
    border: none;
}

.navbar-inverse .dropdown-menu li a:hover {
    background-color: var(--emerald);
}

/* Error and Alert Styles */
.error-summary {
    background-color: #fee;
    border-left: 4px solid #c55;
    color: #c55;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert {
    border-radius: 8px;
    border: none;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.alert-info {
    background-color: #dbeafe;
    color: #082f49;
}

.alert-warning {
    background-color: #fef3c7;
    color: #78350f;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-top-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-top-row {
        grid-template-columns: 1fr;
    }

    .quick-actions-full-width {
        grid-template-columns: 1fr;
    }

    .login-container {
        max-width: 100%;
    }

    .stat-card-horizontal {
        padding: 20px;
    }

    .stat-value {
        font-size: 28px;
    }
}