/* Windows-Style Business UI Framework */
/* Optimized for professional SaaS applications */

:root {
    /* Windows 11 Style Colors */
    --primary-blue: #0078D4;
    --hover-blue: #106EBE;
    --accent-blue: #0063B1;
    --light-gray: #F3F3F3;
    --medium-gray: #E1E1E1;
    --border-gray: #D2D2D2;
    --text-primary: #323130;
    --text-secondary: #605E5C;
    --white: #FFFFFF;
    --success-green: #107C10;
    --warning-yellow: #FFB900;
    --error-red: #D13438;
    
    /* Shadows */
    --shadow-sm: 0 1.6px 3.6px rgba(0,0,0,0.132);
    --shadow-md: 0 3.2px 7.2px rgba(0,0,0,0.132);
    --shadow-lg: 0 6.4px 14.4px rgba(0,0,0,0.132);
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--light-gray);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 0.5em;
    color: var(--text-primary);
}

h1 { font-size: 28px; font-weight: 300; }
h2 { font-size: 20px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; }

a {
    color: var(--primary-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Card Component */
.card {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-gray);
    font-weight: 600;
    background: linear-gradient(to bottom, #FFFFFF, #F8F8F8);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-gray);
    background: linear-gradient(to bottom, #FAFAFA, #F5F5F5);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: all 0.1s ease-in-out;
    font-family: inherit;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

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

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

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

.btn-secondary {
    color: var(--text-primary);
    background-color: var(--white);
    border-color: var(--border-gray);
}

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

.btn-success {
    color: white;
    background-color: var(--success-green);
    border-color: var(--success-green);
}

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

.btn-warning {
    color: var(--text-primary);
    background-color: var(--warning-yellow);
    border-color: var(--warning-yellow);
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 18px;
}

.btn-lg {
    padding: 8px 16px;
    font-size: 16px;
    line-height: 24px;
}

.btn-block {
    display: block;
    width: 100%;
}

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

.form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 400;
    color: var(--text-primary);
}

.form-label.required::after {
    content: " *";
    color: var(--error-red);
}

.form-control {
    display: block;
    width: 100%;
    padding: 6px 8px;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-primary);
    background-color: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 2px;
    transition: border-color 0.1s ease-in-out;
    font-family: inherit;
}

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

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23323130' d='M6 9L2 5h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

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

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.form-check-input {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
}

.form-text {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.form-error {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--error-red);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.table th {
    background: linear-gradient(to bottom, #FAFAFA, #F0F0F0);
    border: 1px solid var(--border-gray);
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.table td {
    border: 1px solid var(--border-gray);
    padding: 8px 12px;
    color: var(--text-primary);
}

.table tbody tr:hover {
    background-color: #F5F5F5;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #FAFAFA;
}

/* Navigation Bar */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border-gray);
    box-shadow: var(--shadow-sm);
    padding: 0;
    display: flex;
    align-items: center;
    min-height: 48px;
}

.navbar-brand {
    display: inline-block;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    flex: 1;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.1s;
}

.nav-link:hover {
    background-color: var(--light-gray);
}

.nav-link.active {
    background-color: var(--primary-blue);
    color: white;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    border-radius: 2px;
    position: relative;
}

.alert-info {
    color: #004578;
    background-color: #F3F9FF;
    border-color: #BEE1F4;
}

.alert-success {
    color: #0B5A08;
    background-color: #DFF6DD;
    border-color: #C3E6C3;
}

.alert-warning {
    color: #6B5900;
    background-color: #FFF4CE;
    border-color: #FFEAA2;
}

.alert-danger {
    color: #731012;
    background-color: #FDE7E9;
    border-color: #F3C8CA;
}

.alert-dismissible {
    padding-right: 40px;
}

.alert .close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
}

.alert .close:hover {
    opacity: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    position: relative;
    width: auto;
    max-width: 500px;
    margin: 50px auto;
    animation: slideDown 0.2s;
}

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

.modal-content {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 16px;
}

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

.close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
}

.close:hover {
    opacity: 1;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--light-gray);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 2px;
}

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

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

.badge-warning {
    color: var(--text-primary);
    background-color: var(--warning-yellow);
}

.badge-danger {
    color: white;
    background-color: var(--error-red);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--primary-blue); }
.text-success { color: var(--success-green); }
.text-danger { color: var(--error-red); }
.text-warning { color: var(--warning-yellow); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.ml-1 { margin-left: 8px; }
.mr-1 { margin-right: 8px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.d-none { display: none; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }

.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .navbar-nav {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-link {
        padding: 10px 16px;
    }
    
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: start;
    }
}
